CertGrid
Data Certification

MongoDB Associate Developer Practice Exam

MongoDB Associate Developer - validates hands-on developer skills with MongoDB: the document model and BSON, CRUD operations (querying with find and operators, inserts, updates, and array/embedded-document manipulation), indexes (single, compound, multikey, and specialized) and reading explain output, data modeling (embedding vs referencing), the aggregation pipeline, and connecting through the official drivers. Uses mongosh / MQL, language-agnostic.

Start with a free MongoDB Associate Developer practice test, then work through 640 exam-style questions with full answer explanations, and take timed mock exams to track your readiness against the exam objectives.

Free account: a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full bank and timed mock exams. No credit card required to start.

640
Practice pool
53 qs
Real exam
75 min
Real exam time
Intermediate
Level

CertGrid runs a fixed 53-question timed mock, separate from the real exam format above.

Objective-mapped practice, aligned to current exam objectives · Reviewed Oct 2026 · Independent practice platform.

What the MongoDB Associate Developer exam covers

Free MongoDB Associate Developer practice test questions

A sample of 10 questions with answers and explanations. A free account includes a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full 640-question bank.

  1. Question 1CRUD Operations

    Which aggregation stage filters documents using query-style criteria, similar to the query passed to find()?

    • A$matchCorrect
    • B$project
    • C$group
    • D$sort
    ✓ Correct answer: A

    $match takes a query document, for example {status:'active'}, and passes through only documents matching that filter, exactly like the filter argument to find().

    Why the other options are wrong
    • B$project reshapes documents (includes, excludes, or computes fields); it does not filter which documents pass through.
    • C$group aggregates documents into buckets; it does not filter by query criteria.
    • D$sort reorders documents; it does not remove any from the pipeline.
  2. Question 2CRUD OperationsSelect all that apply

    Which two statements are true about indexes on a brand-new, empty collection immediately after it is created, implicitly or explicitly? (Choose TWO)

    • AA compound index covering every field is built automatically
    • BA unique index on _id already exists automaticallyCorrect
    • CA text index is created automatically for all string fields
    • DNo secondary (non-_id) indexes exist until explicitly createdCorrect
    • EThe default _id index can be dropped like any other index
    ✓ Correct answer: B, D

    Every collection automatically has a unique index on _id from the moment it is created, but no other (secondary) indexes exist until a developer explicitly creates them with createIndex().

    Why the other options are wrong
    • AMongoDB does not automatically build a compound index over all fields.
    • CText indexes must always be created explicitly, never automatically.
    • EThe default _id index is a protected system index and cannot be dropped like a normal secondary index.
  3. Question 3CRUD Operations

    Which projection document returns only the name field, with _id also removed?

    • A{name: 1}
    • B{name: 0}
    • C{_id: 0}
    • D{name: 1, _id: 0}Correct
    ✓ Correct answer: D

    Including name with name: 1 and explicitly excluding _id with _id: 0 is the one allowed mix of inclusion and exclusion, since _id is exempt from the general mixing rule. The result contains only the name field.

    Why the other options are wrong
    • AThis returns name and _id, since _id is included by default.
    • BThis excludes name and keeps every other field, the opposite of what is needed.
    • CThis removes _id but keeps every other field along with name.
  4. Question 4CRUD Operations

    An `orders` document has an `items` array. Which update sets the qty field of the array element at the fixed, known index 0, regardless of any filter condition?

    • A{$push: {items: {qty: 5}}}
    • B{$set: {"items.0": {qty: 5}}}
    • C{$set: {"items.$.qty": 5}}
    • D{$set: {"items.0.qty": 5}}Correct
    ✓ Correct answer: D

    "items.0.qty" uses dot notation with the numeric index 0 to reach the qty field on the first array element by position, with no dependency on the query filter. items.$.qty instead relies on the positional operator, which needs a matching filter condition; "items.0" without .qty would replace the entire element at index 0; and $push appends a new element rather than modifying an existing one.

    Why the other options are wrong
    • A$push appends a brand-new element to the array instead of modifying the existing element at index 0.
    • BWithout .qty, this replaces the entire subdocument at index 0 rather than just its qty field.
    • CThe positional $ operator depends on a filter condition matching an array element; it is not the same as a fixed numeric index.
  5. Question 5CRUD OperationsSelect all that apply

    Which two methods return the affected document itself rather than only a result summary? (Choose TWO)

    • AfindOneAndUpdateCorrect
    • BupdateOne
    • CfindOneAndDeleteCorrect
    • DdeleteOne
    • EinsertOne
    ✓ Correct answer: A, C

    The findOneAnd... family (findOneAndUpdate, findOneAndReplace, findOneAndDelete) returns the affected document, which is useful for read-modify-write patterns. updateOne, deleteOne, and insertOne return only result summaries such as counts or inserted ids.

    Why the other options are wrong
    • BupdateOne returns matchedCount and modifiedCount, not the document.
    • DdeleteOne returns deletedCount, not the document.
    • EinsertOne returns the insertedId, not a full document.
  6. Question 6Indexes

    A developer wants documents in the sessions collection automatically deleted 3600 seconds after the time stored in createdAt. Which command sets this up?

    • Adb.sessions.createIndex({ createdAt: 1 }, { expireAfterSeconds: 3600 })Correct
    • Bdb.sessions.createIndex({ createdAt: 1 }, { ttl: 3600 })
    • Cdb.sessions.createIndex({ createdAt: 'ttl' }, { seconds: 3600 })
    • Ddb.sessions.createIndex({ createdAt: -1 }, { expireAfter: 3600 })
    ✓ Correct answer: A

    A TTL index is an ordinary single-field index with the expireAfterSeconds option added; a background process removes documents once the indexed field's time plus that many seconds has elapsed.

    Why the other options are wrong
    • B'ttl' is not a recognized createIndex option name.
    • C'ttl' is not a valid index type, and 'seconds' is not the option name.
    • D'expireAfter' is not the option name; it must be expireAfterSeconds.
  7. Question 7CRUD Operations

    A developer needs orders documents where the shipped quantity equals the ordered quantity, comparing two fields within the same document. Which query operator allows this field-to-field comparison in a find() filter?

    • A`$eq`
    • B`$elemMatch`
    • C`$jsonSchema`
    • D`$expr`Correct
    ✓ Correct answer: D

    Ordinary query operators compare a field with a constant. $expr allows aggregation expressions inside a query filter, and the manual states that it can contain expressions that compare fields from the same document, for example { $expr: { $eq: ["$shipped", "$ordered"] } }. The JavaScript-based $where can also compare fields, but the manual says $expr is faster and should be preferred.

    Why the other options are wrong
    • A$eq in a plain filter compares a field with a fixed value; a string such as "$ordered" is treated as literal text, not a field path.
    • B$elemMatch applies conditions to the elements of one array field; it does not compare two separate fields.
    • C$jsonSchema validates a document against a schema; it cannot compare one field with another.
  8. Question 8CRUD Operations

    Three documents match the filter when a developer runs: ``` db.orders.deleteOne({ status: 'cancelled' }) ``` How many documents are removed?

    • AOne: the first document that matches the filterCorrect
    • BThree: deleteOne() removes every match of a non-unique filter
    • CNone: deleteOne() returns an error when several documents match
    • DOne: the match with the lowest _id, as matches are sorted first
    ✓ Correct answer: A

    The manual states that deleteOne() deletes the first document that matches the filter and advises using a field that is part of a unique index, such as _id, for precise deletions. It removes at most one document even when several match, and it has no sort option, so the matches are not ordered by _id first. Removing every match is deleteMany().

    Why the other options are wrong
    • BRemoving every matching document is deleteMany(); deleteOne() removes at most one.
    • CSeveral matches are not an error; deleteOne() deletes the first one it finds.
    • DdeleteOne() takes no sort and does not order matches by _id; it deletes the first document that matches.
  9. Question 9Drivers

    A driver client declares Stable API version 1 and leaves strict at its default. What does this give the application?

    • AThe driver refuses to connect to a server newer than the declared version
    • BThe server rejects every command that is not part of API version 1
    • CCommands in API version 1 keep their behaviour when the server is upgradedCorrect
    • DThe driver rewrites deprecated commands into their version 1 equivalents
    ✓ Correct answer: C

    The Stable API page says it lets you upgrade the MongoDB server at will and ensures behaviour changes between versions do not break your application, as long as the application uses commands in its declared version. It also says clients are non-strict by default and may run any command; only a strict client rejects commands outside the Stable API.

    Why the other options are wrong
    • ADeclaring an API version does not block newer servers; the point is to allow server upgrades.
    • BRejecting commands outside the Stable API happens only with strict: true; the default client is non-strict.
    • DThe driver does not translate commands; the server keeps the declared version's behaviour for supported commands.
  10. Question 10Indexes

    An `inventory` collection has five known attribute fields that queries filter on together in predictable combinations. Why is a compound index on those fields a better choice than a wildcard index?

    • AA wildcard index cannot be used for range conditions on its fields
    • BA wildcard index must be rebuilt whenever a new field name appears
    • CA wildcard index can support only one field predicate in a queryCorrect
    • DA wildcard index cannot support any sort operation on its fields
    ✓ Correct answer: C

    The restrictions page states: "In the case that a single wildcard index could support multiple query fields, MongoDB can only use the wildcard index to support one of the query fields." The wildcard index page adds: "Wildcard indexes don't perform as well as targeted indexes on specific fields." For known fields queried together, a compound index bounds all of them in one scan (MongoDB manual, Wildcard Index Restrictions).

    Why the other options are wrong
    • AWildcard indexes do support range conditions, such as { "product_attributes.price": { $gt: 20 } }.
    • BA wildcard index covers fields as they appear in documents; new field names do not need a rebuild.
    • DA wildcard index can serve a sort when the sort is on the same single, non-array field the index serves for the predicate.

Who this MongoDB Associate Developer practice exam is for

This practice set is for anyone preparing for the MongoDB Associate Developer exam at the intermediate level - from first-time candidates building a foundation to experienced Data practitioners doing a final review before test day. If you learn best by working through realistic questions and reading why each answer is right or wrong, it is built for you.

How to use this MongoDB Associate Developer practice exam

  1. Start with the free sample questions above to gauge your current baseline.
  2. Read the full explanation on every question, including why each wrong option is wrong.
  3. Track your weak domains and focus your study where you are losing the most marks.
  4. Once you are scoring consistently well, take a timed, full-length mock exam.
  5. Use your readiness score to decide when you are ready to book the real MongoDB Associate Developer exam.

Related Data resources

MongoDB Associate Developer practice exam FAQ

How many questions are in the MongoDB Associate Developer practice exam on CertGrid?

CertGrid has 640 practice questions for MongoDB Associate Developer, covering 6 exam domains. The real MongoDB Associate Developer exam is 53 qs in 75 min. CertGrid's timed mock is a fixed 53 questions.

What is the passing score for MongoDB Associate Developer?

MongoDB does not state a passing score on its exam page, so the threshold here is CertGrid's own readiness bar rather than MongoDB's. You have about 75 min to complete it. CertGrid tracks your readiness against the exam objectives so you know where to focus.

Are these official MongoDB Associate Developer exam questions?

No. CertGrid is an independent practice platform. We do not provide real or leaked exam questions. Our questions are original and designed to help you practice the concepts, scenarios, and difficulty style of the MongoDB Associate Developer exam.

Is there a free MongoDB Associate Developer practice test?

Yes. You can take a free MongoDB Associate Developer practice test straight away: a fixed set of 20 practice questions for this exam, retryable as often as you like, with no credit card required. You get readiness scoring and a weak-domain breakdown on those questions. Paid plans unlock the full 640-question bank, timed mock exams and full-bank domain analytics.

What CertGrid is (and is not)

CertGrid is an independent IT certification practice platform for Azure, AWS, Google, Cisco, Security, Linux, Kubernetes, Terraform, and other certification tracks. It provides objective-mapped practice questions, readiness scoring, weak-domain drills, and explanations to help learners understand what to study next.

Independent & original. CertGrid is an independent practice platform and is not affiliated with or endorsed by MongoDB. Questions are original practice items designed to mirror certification concepts and exam style. CertGrid does not provide official exam questions or braindumps.