Courseiva
CRUD Operations →mediumMultiple Choice

C100DBA CRUD Operations Practice Question

Exhibit

db.users.updateMany({active: false}, {$set: {status: 'archived'}}, {writeConcern: {w: 'majority'}})

Refer to the exhibit. What is the effect of the 'writeConcern' parameter in this operation?

⚠ Common exam trap

Candidates often assume 'majority' write concern means the data is written to all nodes. They fail to realize it only requires a quorum of voting members.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

It ensures the data is replicated to most nodes before acknowledgment.

The write concern {w: 'majority'} ensures that the operation is only acknowledged after it has been written to a majority of the replica set members. This is essential for data durability and preventing data loss in the event of a primary node failover. It provides a stronger guarantee than the default 'w: 1' by ensuring that data is replicated before the application proceeds.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    It forces the update to occur only on the primary node.

    Why it's wrong here

    Write concern defines the acknowledgment level, not the node selection. Updates are always directed to the primary node in a replica set. The 'majority' setting ensures the primary has successfully replicated the change to a sufficient number of secondary nodes before confirming success to the client application.

  • ✓

    It ensures the data is replicated to most nodes before acknowledgment.

    Why this is correct

    Setting w: 'majority' ensures that the write operation is committed to a majority of the voting members in the replica set. This provides a high level of data durability, ensuring that if a failover occurs, the update will persist on the newly elected primary node.

  • ✗

    It only updates documents that have a majority of fields set.

    Why it's wrong here

    Write concern is a configuration for acknowledgment, not a filter for the documents being updated. It has no impact on which documents match the query criteria. The update will apply to all documents where 'active' is false, regardless of how many fields are present in the documents.

  • ✗

    It makes the update operation read-only.

    Why it's wrong here

    Write concern is strictly for write operations. It has nothing to do with read permissions or the type of operation being performed. The operation is a valid update, and the write concern simply specifies the durability guarantee level for the confirmation of that write to the client application.

About these practice questions

This C100DBA question is part of Courseiva's 222-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official MongoDB exam blueprint

This C100DBA practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DBA exam.