20+ practice questions focused on CRUD Operations — one of the most tested topics on the MongoDB Certified Associate Developer exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start CRUD Operations PracticeAn application needs to update a document in the 'orders' collection. If the document matching the query does not exist, a new document must be inserted using fields from both the query and the update document. Which parameter accomplishes this behavior?
Explanation: The upsert option instructs MongoDB to insert a new document when no existing document matches the query filter. By default, updates only modify existing records, but combining query criteria with update operators during an upsert ensures data completeness. This pattern is fundamental for idempotent data ingestion pipelines where record creation and modification share a unified entry point, preventing race conditions.
A developer is writing a bulk operation against the 'inventory' collection using db.inventory.bulkWrite(). The batch must (1) insert a new item only if no document already exists with the same 'sku', and (2) increment the 'qty' field of an existing item by 5 in the same round trip. Which two operations should be included in the bulkWrite array to meet these requirements? (Choose two.)
Explanation: The conditional insert is achieved with an upsert updateOne using $setOnInsert, which only writes fields when the insert path is taken. The increment is achieved with a separate updateOne applying $inc to qty without upsert, so it modifies an existing document only. Together they fulfill both requirements in a single bulkWrite round trip.
A booking system stores reservations in the 'reservations' collection. Each document has a 'guests' array of embedded subdocuments, each with 'name' and 'checkedIn' fields. An operator needs to mark only the subdocument whose 'name' is 'M. Chen' as checked in, leaving all other array elements unchanged. Which update accomplishes this?
Explanation: The positional $ operator is the canonical way to update the first array element matched by the query. The query 'guests.name': 'M. Chen' establishes which element the $ refers to, and the $set targets that element's field. Omitting the positional operator or using the all-positional operator both fail to achieve the single-element targeting.
A monitoring service writes metric documents with a 'sensorId' field to the 'metrics' collection. The application occasionally retries writes and must avoid creating duplicate documents when a document with the same 'sensorId' already exists. The update should set 'lastSeen' to the current date and increment a 'readings' counter when the sensor already exists. Which operation meets both requirements?
Explanation: An upsert combined with $set and $inc handles both branches: insert when absent, update when present. The filter field is reused in the inserted document, and the increment operator preserves the running count. Replacement and insert-only approaches either reset the counter or create duplicates.
A developer needs to retrieve documents from the 'sensors' collection where the 'readings' array contains at least one element greater than 100, but the query must return only the first matching element from each array. Which projection correctly limits the returned array to the first matching element?
Explanation: The $elemMatch projection operator returns the first array element matching a condition, making it the right tool when only the first matching element is wanted. Positional $slice, full inclusion, and aggregation $filter either ignore the predicate, return everything, or are invalid in a find projection. This distinction is important for APIs that should surface a single representative reading per sensor.
+15 more CRUD Operations questions available
Practice all CRUD Operations questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of CRUD Operations. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
CRUD Operations questions on the C100DEV frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. CRUD Operations is tested as part of the MongoDB Certified Associate Developer blueprint. Practicing with targeted CRUD Operations questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free C100DEV practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but CRUD Operations is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full CRUD Operations practice session with instant scoring and detailed explanations.
Start CRUD Operations Practice →