C100DBA CRUD Operations Practice Question
Which update operator would you use to increase the value of a numeric field by a specific amount?
⚠ Common exam trap
Candidates often mistakenly use the $set operator with arithmetic expressions to update numeric fields, completely ignoring the atomic server-side increment capabilities provided by the $inc operator.
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
✓
$inc
The $inc operator is the standard tool for atomic numeric increments. It is highly efficient because it allows the database to perform the math on the server side without requiring the client to read the current value, perform the addition locally, and write it back. This eliminates race conditions where two clients might read the same value and overwrite each other's increments.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
$add
Why it's wrong here
$add is an aggregation framework expression used within $project or $group stages, not an update operator. Attempting to use it in an update document will result in an error, as update operations require specific modifiers like $inc to change document data outside of an aggregation pipeline.
- ✓
$inc
Why this is correct
The $inc operator atomically increments a field by the specified amount. It supports both positive and negative values for incrementing and decrementing, respectively. This is the correct choice for managing counters, such as page views or inventory levels, where accuracy under high concurrency is a strict requirement.
- ✗
$set
Why it's wrong here
$set overwrites the existing value with a new value. To use $set for incrementing, you would need to fetch the value first, update it in your code, and send it back. This sequence is not atomic and risks overwriting changes made by other concurrent database operations.
- ✗
$mul
Why it's wrong here
$mul is used for multiplying the value of a field by the specified number. While it is a numeric update operator, it performs multiplication rather than addition. It is useful for scaling values, but it does not accomplish the task of incrementing a field by a specific amount.
About these practice questions
Courseiva writes every C100DBA question from scratch — 222 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.