Courseiva

C100DEV · domain

MongoDB Overview and Document Model

This domain covers MongoDB's core document model and how it differs from relational design. Questions test schema flexibility, BSON document structure, embedding versus referencing, and named design patterns like Bucket and Extended Reference. Expect scenario-based items asking you to choose the right pattern or explain why an insert or query behaves as shown in an exhibit.

38 questions9 easy23 medium6 hard

Focused practice

Practice MongoDB Overview and Document Model questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about MongoDB Overview and Document Model

You must be able to read a document or scenario and decide the correct data model: embed, reference, or apply a named pattern such as Bucket. The single most important thing is matching the pattern to the access pattern, since MongoDB designs around how data is queried, not normalization.

BSON document structure, field types, and the _id field's default ObjectId behavior

Schema-flexible modeling: documents in one collection may have different fields

Embedding versus referencing for one-to-many and one-to-one relationships

Named patterns including Bucket, Extended Reference, Subset, and Computed patterns

Watch out for

Common MongoDB Overview and Document Model exam traps

  • ▸Assuming MongoDB enforces a fixed schema per collection; it does not, though you can add JSON Schema validation.
  • ▸Embedding unbounded arrays that grow without limit, causing large documents and poor performance instead of using the Bucket pattern.
  • ▸Confusing when to reference versus embed; referencing adds application-side joins via $lookup and extra round trips.

Question index

All MongoDB Overview and Document Model questions (38)

Click any question to see the full explanation, or start a practice session above.

1

A developer is building a MongoDB application that stores social media posts. Each post document includes an array of comments, and each comment is a subdocument with fields such as author, text, and timestamp. The developer later needs to update a specific comment's text. Which update operation should they use to modify only the targeted comment's text without replacing the entire comments array?

Medium
2

An e-commerce application stores products in a collection. Each product has a variable number of attributes, such as 'size', 'color', or 'material'. Which data modeling approach best leverages MongoDB's flexible schema while maintaining query efficiency?

Medium
3

A developer is using the MongoDB Node.js driver to insert a document into a collection. The document includes a field `_id` set to a custom string value. After the insert, the developer checks the returned result and notices that the `insertedId` matches the custom string. What does this indicate about MongoDB's handling of the `_id` field?

Medium
4

A developer is designing a MongoDB collection to store blog posts. Each post has a title, content, and an array of tags. The developer wants to ensure that the tags field is always an array of strings. Which BSON data type should be used for the tags field?

Easy
5

A team is designing a MongoDB collection to store user profiles. Each profile document includes a `name` string, an `age` integer, and an array of `hobbies` strings. A new developer asks which BSON type is used to represent the `hobbies` field in the stored document. What is the correct BSON type for an array of strings?

Easy
6

A development team is building a MongoDB application to store user profiles. They want to enforce that every user document contains an 'email' field of type string, and they want documents that violate this rule to be rejected at insert time. Which MongoDB feature should they use?

Medium
7

A developer is designing a MongoDB collection to store blog posts. Each post document includes an array of comments, and each comment has fields such as 'author', 'text', and 'timestamp'. The developer wants to optimize for queries that retrieve posts along with their comments, and also wants to ensure that comments are stored efficiently. Which two of the following statements are true regarding the document model in this scenario? (Choose two.)

Medium
8

A development team is modeling a MongoDB collection for a ticketing system. Each ticket has a unique ticketId, a status, and a variable set of custom fields that differ by department. The team wants to ensure that queries on ticketId and status can use indexes efficiently and that the custom fields remain flexible. Which statement best describes how the document model supports this requirement?

Medium
9

Refer to the exhibit. Why would an operation attempting to insert the document shown in the exhibit fail?

Hard
10

A developer is modeling a blog platform. Posts are read frequently, and each post has a small, bounded set of tags. The tags are always displayed with the post and are never queried independently across posts. The developer is deciding between embedding the tags as an array inside each post document versus storing them in a separate tags collection with references. Which design choice aligns with MongoDB document model guidance for this scenario?

Medium
11

A developer is designing a MongoDB collection to store user profiles. Each profile document includes fields for name, email, and an array of phone numbers. The developer wants to ensure that the email field is unique across all documents. Which MongoDB feature should be used to enforce this constraint?

Easy
12

A developer is building a MongoDB application to store user profiles. Each profile document includes a field `lastLogin` that records the exact date and time of the user's most recent login. The developer wants to ensure that this field is stored using the most appropriate BSON type for date and time values, allowing for efficient range queries and sorting. Which BSON type should be used for the `lastLogin` field?

Medium
13

A developer is working with a MongoDB collection that stores product data. Each product document has a 'price' field. The developer needs to find all products with a price greater than 100 and less than 200. Which query operator should be used?

Medium
14

An application needs to store an e-commerce catalog where products have varying attributes such as clothing sizes or electronic specifications. You choose MongoDB for its dynamic schema. Which design approach best leverages the MongoDB document model for this use case?

Medium
15

A financial application stores transaction records in a MongoDB collection. Each transaction document includes a Decimal128 amount field and a Date field for the transaction time. A developer needs to query for transactions with amounts greater than 100.00 and times within the last 24 hours, and wants the queries to use indexes efficiently. Which statement about the document model and BSON types is correct for this scenario?

Hard
16

A developer is new to MongoDB and is examining a collection of documents. Each document contains fields like `name`, `age`, and `address`, where `address` is a nested document with `street`, `city`, and `zip`. The developer wants to query for all documents where the `city` in the nested `address` document is 'New York'. Which query correctly retrieves these documents?

Easy
17

A developer is designing a MongoDB collection to store sensor readings. Each reading document contains a sensorId, a timestamp, and a readings array of subdocuments with type and value fields. The application frequently queries for readings where the readings array contains a subdocument with type "temperature" and value greater than 30. Which document model feature allows the query to match elements within the array efficiently?

Medium
18

A developer stores product documents in a MongoDB collection. Some documents include a nested details object with a warranty subfield, while others do not. The developer needs to retrieve only the documents where details.warranty equals the string "2 years". Which query correctly targets that nested field?

Medium
19

A developer is working with a MongoDB collection that stores sensor readings. Each document contains a timestamp, sensor ID, and a nested object 'readings' with fields like 'temperature', 'humidity', and 'pressure'. The developer needs to query for all documents where the temperature reading exceeds 30 degrees Celsius. Which query correctly retrieves these documents?

Medium
20

A developer is building a MongoDB application that tracks server metrics. Each metric document must include a timestamp, and the application frequently queries metrics for a specific server within a date range. The developer wants to ensure that the timestamp field is stored in a way that supports efficient range queries and sorting. Which BSON data type should the timestamp field use?

Medium
21

A financial application stores transaction documents in a MongoDB collection. Each document includes fields such as 'transactionId', 'amount', 'currency', and 'timestamp'. The application requires that the 'amount' field always be present and be a double, and that 'currency' be one of a predefined list of ISO codes. Which MongoDB feature should the developer use to enforce these requirements at the database level?

Hard
22

An application stores customer profiles in a MongoDB collection. A developer notices that documents created by different services have inconsistent shapes: some use a string for phone, others an array of strings, and some omit the field entirely. The team wants to enforce a consistent structure for new writes while still allowing existing documents to remain. Which MongoDB feature should they use?

Hard
23

A developer is reviewing the characteristics of MongoDB documents. Which two of the following statements are accurate? (Choose two.)

Medium
24

A developer is reviewing how MongoDB represents and stores data at the document level. Which TWO statements accurately describe the behavior of the BSON format and MongoDB documents? (Choose two.)

Medium
25

Which document design pattern should be used to store a one-to-many relationship where the child documents are frequently accessed together with the parent?

Medium
26

A financial application stores transactions in a MongoDB collection. Each transaction document includes a 'timestamp' field. The application needs to query transactions for a specific day, and the queries must be efficient. Which indexing strategy is most appropriate?

Hard
27

A developer is building an inventory system for a hardware store. Each item document needs to store the product's name, a unique SKU, the quantity on hand, and a list of compatible replacement part numbers. The developer wants to ensure that the `sku` field is always present and is a string, while still allowing other fields to vary between item types. Which MongoDB feature should the developer use to enforce this requirement?

Medium
28

When designing a document model, which factor is most important for determining whether to embed or reference data?

Easy
29

A development team is designing a MongoDB collection to store sensor readings. Each reading document contains a `sensorId`, a `timestamp`, and a `value`. The team expects billions of readings and needs to optimize for fast queries that retrieve the latest reading for a specific sensor. They decide to use a compound index. Which index key order best supports this query pattern?

Hard
30

A developer is working with a MongoDB collection that stores product data. The collection has documents with a field 'price' that is sometimes stored as a double and sometimes as a string, due to inconsistent data entry. A query is run to find all products with a price greater than 100. What is the expected behavior of this query?

Medium
31

Which of the following describes the behavior of the BSON format within MongoDB?

Easy
32

A developer is building a MongoDB application to store sensor readings from thousands of IoT devices. Each reading document contains a device ID, timestamp, and an array of up to 100 numeric values. The developer wants to minimize document size and storage overhead while preserving the ability to query individual readings. Which BSON data type should be used to store the numeric values array to achieve the smallest document size?

Medium
33

A development team is migrating a legacy application to MongoDB. They need to store product inventory data that includes a unique identifier, a name, a price, and a list of warehouse locations with quantities. The team wants to minimize the number of queries required to retrieve all information for a product. Which MongoDB document design approach best meets this requirement?

Medium
34

What is the primary benefit of the 'Bucket Pattern' in MongoDB data modeling?

Medium
35

Which of the following describes the 'schema-flexible' nature of MongoDB?

Easy
36

A developer is designing a MongoDB collection to store user profiles for a mobile application. Each profile document may contain a varying set of optional fields, such as 'phoneNumber', 'profilePicture', and 'preferences'. The developer wants to ensure that the database can efficiently store and query these documents without requiring a predefined schema. Which MongoDB feature best supports this requirement?

Easy
37

A developer is writing a Node.js script that inserts a user document into a MongoDB 7.0 collection. The document includes an _id field whose value is generated by the driver as an ObjectId. A teammate asks why the _id field is present even though the insertOne call did not specify it. Which statement best explains the behavior of _id in MongoDB?

Easy
38

A developer is reviewing a MongoDB collection that stores blog posts. Each post document has a field 'tags' that is an array of strings. The developer wants to find all posts that have both 'mongodb' and 'database' in the tags array. Which query correctly retrieves these documents?

Medium

Frequently asked questions

What does the MongoDB Overview and Document Model domain cover on the C100DEV exam?
You must be able to read a document or scenario and decide the correct data model: embed, reference, or apply a named pattern such as Bucket. The single most important thing is matching the pattern to the access pattern, since MongoDB designs around how data is queried, not normalization.
How many questions are in this domain?
This page lists all 38 MongoDB Overview and Document Model questions in the C100DEV question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only MongoDB Overview and Document Model questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
mongodb-associate-developer MONGODB-ASSOCIATE-DEVELOPER mongodb overview document model Practice Questions