C100DEV · domain
scenario questions
Practise MongoDB Certified Associate Developer scenario questions practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.
Focused practice
Practice scenario questions 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 scenario questions
scenario questions questions test whether you can apply the concept in context, not just recognise a definition.
How the topic appears in realistic exam-style scenarios.
Which detail in the question changes the correct answer.
How to eliminate plausible but wrong options.
How to connect the question back to the wider exam objective.
Watch out for
Common scenario questions exam traps
- ▸Answering from memory before reading the full scenario.
- ▸Missing a constraint such as cost, availability, security, scope or command context.
- ▸Choosing a broad answer when the question asks for the most specific fix.
- ▸Ignoring why the wrong options are tempting.
Question index
All scenario questions questions (259)
Click any question to see the full explanation, or start a practice session above.
Refer to the exhibit. What is the impact of setting 'dynamic' to true in this Atlas Search index definition?
Hard2When should a TTL (Time-To-Live) index be used in a MongoDB collection?
Medium3A MongoDB application stores inventory documents in the 'inventory' collection with fields 'sku', 'on_hand', and 'reserved'. During a flash sale, many concurrent sessions must decrement 'on_hand' by 1 only when on_hand is greater than 0, and each successful decrement must return the resulting document to the client. Which approach guarantees this behavior?
Hard4A developer needs to perform a point-in-time backup of a MongoDB replica set while the database remains online and serving reads and writes. Which MongoDB Database Tool is designed for this task?
Easy5When creating an index on a large collection in a production environment, what is the primary advantage of using the 'background' option (for versions prior to 4.2) or the standard build process in 4.2+?
Easy6Refer to the exhibit. An application receives this error during a multi-document transaction. What is the correct approach for the application developer?
Medium7You are designing a schema for a social application where each user document stores an array of their last 50 notifications. Notifications are frequently added, and the application only needs to display the most recent 50. Which schema design approach best supports this requirement while minimizing document growth?
Medium8A social media platform stores posts in a collection named posts. Each post document contains an array field `comments`, where each comment is a subdocument with fields `user` and `text`. The development team needs to generate a report that lists each comment as a separate document, including the post's `_id` and the comment's `user` and `text`. Which aggregation stage should be used to achieve this?
Medium9What is the primary function of the MongoDB connection pool in a driver?
Easy10An inventory system stores each product's supplier as an embedded subdocument containing the supplier name, address, and contact email. The supplier's address changes frequently, and updates now require scanning and updating thousands of product documents. Which data modeling change best resolves this maintenance problem?
Easy11Which operator is used to perform a left outer join between two collections in an aggregation pipeline?
Easy12A developer wants to query MongoDB Atlas Search for documents where the 'description' field contains the phrase 'wireless headphones'. Which Atlas Search operator should be used to achieve this?
Easy13A developer is troubleshooting a Python application that uses the MongoDB driver to query the 'products' collection with find({'category': 'tools'}). Which two statements about the returned cursor are correct? (Choose two.)
Medium14A development team is designing a schema for a chat application where each conversation contains messages that grow continuously. Messages are read in chronological order, and the application must display the most recent 50 messages quickly while retaining the full history. Which TWO design decisions best support these requirements? (Choose two.)
Hard15A 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?
Medium16A developer needs to ensure that a `users` collection does not contain two documents with the same email address. Which index type should be created on the `email` field?
Easy17When using the $lookup stage, what happens if the 'foreignField' contains values that are not present in the 'localField' of the joined collection?
Medium18An 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?
Medium19A developer is working with a MongoDB collection that stores user profiles. The collection has an index on the `email` field. The developer runs a query to find a user by email and then examines the query plan using `explain()`. The output shows that the query used an `IXSCAN` stage. What does this indicate about the query execution?
Easy20A 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?
Medium21A developer is using mongosh to connect to a MongoDB Atlas cluster and needs to run several administrative commands. The developer wants to ensure that the connection uses the correct authentication database and that all commands are executed with the appropriate read preference. Which mongosh command-line option should be used to specify the authentication database?
Hard22A financial analytics team stores daily stock snapshots as one document per symbol per day in a collection named 'prices'. Each document contains an array of 60 subdocuments, one per minute, with fields 'minute', 'open', 'close', and 'volume'. The team now needs to compute the hourly average 'close' for a single symbol over a single day. Which aggregation approach is most appropriate for this schema?
Medium23What is the primary benefit of using a partial index in MongoDB?
Hard24What is the primary benefit of the 'Extended Reference Pattern'?
Medium25A developer maintains a collection of sensor readings. Queries almost always filter on `status` and then sort by `timestamp` descending. The current index is { status: 1, timestamp: 1 }. The developer observes that the query planner selects a COLLSCAN even though the index covers both fields. Which index change should be made to allow an efficient index scan for this query?
Medium26A developer is using the MongoDB Node.js driver to perform a multi-document transaction that includes a read operation followed by a write operation. The developer wants to ensure that the read sees a consistent snapshot of the data and that the write is atomic with the read. Which of the following read concerns should be used for the read operation within the transaction?
Hard27Refer to the exhibit. You are implementing the Subset Pattern for a user profile that tracks recent orders. As the number of orders per user grows indefinitely, which strategy prevents the 'unbounded array' anti-pattern?
Hard28A product catalog must support thousands of products whose attributes differ significantly: books have ISBN and page count, electronics have wattage and warranty, and clothing has size and material. Queries frequently filter on these type-specific attributes. Which schema design best supports this requirement in MongoDB?
Medium29A developer is designing a collection to store catalog items. Different item categories have different attributes: books have 'isbn' and 'pageCount', while electronics have 'wattage' and 'warrantyMonths'. All items share '_id', 'name', 'price', and 'category'. Which data modeling approach best fits this requirement?
Easy30A 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?
Easy31A developer is working with a MongoDB collection that stores user profiles. The collection has a unique index on `email` and a compound index on `{ lastName: 1, firstName: 1 }`. The developer needs to enforce that no two documents have the same combination of `tenantId` and `username`. Which TWO of the following statements are correct regarding the creation and behavior of a unique compound index for this requirement? (Choose two.)
Hard32Refer to the exhibit. What is the most appropriate next step for an application encountering this error?
Medium33A developer needs to quickly inspect the contents of a collection and run ad-hoc queries against a MongoDB Atlas cluster without installing any additional software. Which tool should be used?
Easy34A logistics application stores shipment records in a collection where each document has a numeric field `weight_kg`. Queries frequently filter on `weight_kg` with a range (e.g., between 50 and 200) and sort by `weight_kg` ascending. You create a standard ascending index on `weight_kg`. Which statement best describes the index's behavior for these queries?
Medium35What happens if an aggregation stage exceeds the 100MB memory limit and 'allowDiskUse' is set to false?
Medium36Which aggregation operator is most appropriate for counting the total number of documents in a collection?
Easy37A developer is working with a MongoDB collection that stores sensor readings. Each document has a 'sensorId' field and a 'readings' array containing numeric values. The developer creates an index on the 'readings' field. Which statement best describes the resulting index?
Easy38A retail application queries an `orders` collection with a filter on `status` and `customerId`, and a sort on `orderDate`. The query shape is: `db.orders.find({ status: "shipped", customerId: 12345 }).sort({ orderDate: -1 })`. The collection has no indexes other than the default `_id` index. Which index should be created to best support this query according to the ESR guideline?
Medium39A 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?
Easy40Which TWO of the following are valid accumulators that can be used within a $group stage?
Medium41A logistics application stores shipment documents in the 'shipments' collection. Each document has a 'packages' array of embedded subdocuments, each with a 'trackingCode' field. A developer needs to remove only the embedded subdocument whose 'trackingCode' equals 'TRK-9981' from the document with '_id' 42, leaving all other packages untouched. Which update operation should be used?
Medium42Which MongoDB tool should be used to perform a point-in-time backup of a MongoDB cluster while the database is running?
Easy43A 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?
Medium44A pipeline on a `sales` collection must return only the `item` and `price` fields for all documents where `price` is greater than 50, and it should not return the `_id` field. Which pipeline achieves this?
Easy45You have a collection of 'Users' and a collection of 'Groups'. Users can belong to many groups, and groups can have many users. Which modeling approach is most scalable for this many-to-many relationship?
Hard46A financial reporting system reads account documents that each contain a nested array of the last 90 daily balance snapshots. Analysts run aggregations that only need the current balance and account type, but the full snapshot array is being loaded on every read. Which schema pattern most directly reduces the working set size for these read-heavy analytics queries?
Hard47A developer is building an application that uses the MongoDB Node.js driver to perform a multi-document transaction. The transaction includes an update to an 'inventory' collection and an insert into an 'orders' collection. During testing, the developer notices that occasionally the transaction aborts with a TransientTransactionError. What is the most appropriate way to handle this error in the application code?
Hard48A developer runs `mongosh` against a replica set and wants to inspect the current database's collections before writing any queries. Which command should be executed?
Easy49An application requires grouping orders by customer ID and calculating the total purchase amount per customer. However, some customers have orders with missing or null purchase amounts that must be excluded before calculation. Which aggregation pipeline stage sequence correctly achieves this goal?
Medium50A 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.)
Medium51An inventory collection stores documents with a numeric 'quantity' field. A warehouse system must decrement quantity by 5 on a specific item, and if the field is missing it should be created starting from the decremented value. Which update operator and command achieve this?
Medium52Which stage is used to change the order of documents in an aggregation pipeline?
Easy53A social platform stores user profiles in a 'users' collection and their posts in a 'posts' collection. Each post document embeds a small 'author' subdocument with 'userId', 'displayName', and 'avatarUrl'. A user changes their display name. The application must keep existing posts showing the new name. What is the most accurate statement about this Extended Reference design?
Hard54You have a document with an unbounded array of data. Which TWO strategies help mitigate the risk of exceeding the 16MB document size limit?
Hard55A 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?
Medium56Which TWO of the following are common use cases for using the 'mongosh' shell in a production environment?
Medium57You maintain a MongoDB collection named `readings` that stores hourly sensor measurements. Each document includes a `sensorId` string, a `recordedAt` date, and a `temperature` numeric value. You need to produce a report that, for each sensor, lists the sensor identifier alongside the timestamp of its single highest temperature reading. Duplicate temperatures are possible, and in that case any one of the tied readings is acceptable. Which aggregation pipeline should you run?
Medium58A team is modeling a schema for an order-processing system that must support atomic updates across an order and its line items and must guarantee that reading an order never returns a partially updated set of line items. (Choose two.)
Hard59Refer to the exhibit. Why would an operation attempting to insert the document shown in the exhibit fail?
Hard60Which aggregation operator is used to transform the shape of documents by adding, renaming, or excluding fields?
Easy61Which TWO stages are considered 'blocking' stages that can potentially consume excessive memory if not managed correctly?
Medium62You are designing an e-commerce catalog where products can have a dynamic array of tags. You need to query for documents where the 'tags' array contains both 'electronics' and 'sale' simultaneously, regardless of their order or other elements. Which query operator should you use?
Medium63An IoT platform ingests sensor readings every second from thousands of devices. The team wants to minimize the number of documents and index entries while still querying by device and time range. Which schema design best matches these requirements?
Medium64A 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?
Medium65A logistics application stores shipment records in a MongoDB collection where each document includes a 'status' field (e.g., 'pending', 'in_transit', 'delivered') and a 'createdAt' date. The operations team frequently runs the query: db.shipments.find({ status: 'in_transit' }).sort({ createdAt: -1 }).limit(20). They want an index that allows this query to execute without an in-memory sort and with minimal keys scanned. Which index should you create?
Medium66Which approach is best for handling a 'One-to-Squillions' relationship in MongoDB?
Medium67A 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?
Easy68A healthcare application stores patient records. Each patient document includes a `medications` array of subdocuments, each with `name`, `dosage`, and `frequency`. The application needs to query patients who are taking a specific medication with a specific dosage. The array is expected to grow to hundreds of entries per patient. Which schema design best supports efficient querying and management of this data?
Hard69A 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?
Medium70A financial application stores transactions in a collection named transactions. Each document has fields: `accountId` (string), `amount` (decimal), `type` (string, either 'debit' or 'credit'), and `timestamp` (date). The team needs to calculate the net balance per account, defined as the sum of credits minus the sum of debits. The result should include only accounts with at least 10 transactions. Which aggregation pipeline achieves this?
Hard71A catalog stores products of many categories, each with different attributes: books have ISBN and author, while electronics have voltage and warrantyMonths. Queries always filter by category and then by category-specific attributes. Which schema approach best supports these queries?
Easy72A 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?
Medium73You are designing a schema for an e-commerce platform where products have a variable number of attributes like color, size, and material. Which modeling approach provides the best balance of flexibility and query performance for filtering products by these dynamic attributes?
Medium74What is the primary technical limitation when creating a covered query?
Hard75Refer to the exhibit. Which stage should be used to transform this document into three separate documents, one for each tag?
Medium76An 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?
Medium77A logistics application stores shipment records in the 'shipments' collection. Each document includes a 'status' field and a 'deliveredAt' field (a Date). A developer must set 'deliveredAt' to the current date and time for every shipment whose 'status' is 'in_transit' and whose 'carrier' is 'FastShip'. Which operation satisfies this requirement with a single command?
Medium78An analytics job updates counters in the 'metrics' collection with db.metrics.updateOne({ metric: "visits" }, { $inc: { count: 1 } }). The job runs with write concern w:1 against a three-node replica set, and a failover occurs immediately after the primary acknowledges a write. The developer reports that a counter increment appears to be lost. Which statement best explains this outcome?
Hard79When using the MongoDB C#/.NET driver, which object is essential for managing the scope and lifecycle of a multi-document transaction?
Medium80Which operator is used within a $project stage to calculate the square root of a numerical field?
Easy81What is the purpose of the $accumulator stage in the aggregation framework?
Medium82A financial application has a collection `transactions` with fields `accountId`, `type`, `amount`, and `createdAt`. A query filters on `accountId` and `type`, sorts descending by `createdAt`, and projects only `_id` and `amount`. A developer creates the index `{ accountId: 1, type: 1, createdAt: -1 }`. Which statement best describes whether this index can support the query as a covered query?
Hard83Refer to the exhibit. What happens to documents in the collection that do not contain the 'category' field?
Hard84What is the primary benefit of using an index with the $match stage at the beginning of an aggregation pipeline?
Medium85A developer is working with a collection 'products' that has an index { category: 1, price: 1 }. They want to understand how MongoDB can use this index for queries that include a sort on price. Which TWO of the following statements are true regarding the use of this index for sorting? (Choose two.)
Hard86Refer to the exhibit. What is the effect of the $unwind stage on the aggregation pipeline?
Hard87A collection 'orders' has a compound index { status: 1, customerId: 1, orderDate: -1 }. A developer runs a query: db.orders.find({ customerId: 'C123', status: 'shipped' }).sort({ orderDate: -1 }). Which statement about how MongoDB uses this index for the query is correct?
Medium88A reporting service reads from the 'sensor_readings' collection, which contains millions of documents. The service runs a query that filters on 'deviceId' and returns results sorted by 'recordedAt' descending. The query performs a collection scan and an in-memory sort, causing high memory usage. Which index should you create to allow the query to use an index for both filtering and sorting?
Medium89You are processing a large collection of user sessions. You need to calculate the average duration of sessions grouped by 'userId', but you must filter out any sessions lasting less than 5 seconds before performing the grouping. Which stage order is most efficient?
Medium90An analytics collection contains order documents with an array of items. You need to output a single document for each element in the items array while preserving documents that have an empty or missing items array. Which stage configuration achieves this?
Hard91A 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?
Hard92A developer is debugging a multi-document transaction in the MongoDB Node.js driver. The transaction updates a document in the `orders` collection and inserts into `audit`. The commit fails with a `WriteConflict` error that does not carry the `TransientTransactionError` label. What is the most appropriate action?
Hard93When modeling with MongoDB, why should you avoid 'unbounded' growth in an array field?
Easy94A library management system stores book information in a `books` collection. Each book document includes fields such as `title`, `author`, `ISBN`, and `genre`. The application frequently queries books by `genre` and `author`. Which index strategy is most appropriate to optimize these queries?
Easy95Which operator is most appropriate to concatenate an array of strings into a single string field?
Medium96When designing a schema for a time-series dataset, why is it recommended to use the 'Bucket' pattern?
Medium97A 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?
Easy98A sensor platform writes readings to the 'readings' collection. A developer needs to insert three documents in a single operation and have the server process them in the given order, stopping at the first error rather than continuing. Which insert command should be used?
Medium99What is the primary purpose of the 'causal consistency' feature provided by MongoDB sessions?
Hard100A developer needs to insert a single document into the 'inventory' collection and wants the operation to return the generated _id value in the result. Which method should be used?
Easy101A developer uses the MongoDB Node.js driver to run a multi-document transaction that updates an accounts collection and inserts a ledger entry. The transaction commits successfully, but a second application instance immediately reads the ledger entry through a session that is not causally linked to the transaction session and receives stale data. The developer wants the second instance to observe the transaction's committed writes without changing the transaction itself. Which approach should the developer use?
Hard102You are optimizing a collection containing user logs. Queries frequently filter by 'category' and sort by 'timestamp' in descending order. Which index configuration best supports these queries while maintaining efficiency?
Medium103In an aggregation pipeline, what is the purpose of the $addFields stage?
Medium104A developer needs to create a backup of a MongoDB deployment that includes all databases and their indexes, and then restore it to a different server. The backup should be in a binary format that preserves BSON data types. Which tool should be used to create the backup?
Medium105You are building an aggregation pipeline that processes millions of documents. The pipeline includes a $match stage, a $group stage that calculates sums, and a $sort stage. You notice the pipeline is spilling to disk and running slowly. Which stage should you place first to optimize performance while maintaining correct results?
Hard106A 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?
Medium107A 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?
Medium108What is the primary function of the explain() method in MongoDB?
Easy109You need to ensure that values in the 'email' field are unique across all documents in a collection, but documents where the 'email' field is missing should not violate this constraint. How should you create this index?
Medium110A 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?
Medium111Refer to the exhibit. Which design pattern is used to store 'total_price' in the document?
Hard112Which index type should be used to support efficient queries on a field containing geographical coordinates in MongoDB?
Easy113A logistics company stores shipment events in a collection where each document contains a `history` array of subdocuments with fields `status`, `timestamp`, and `location`. Queries frequently filter on `history.status` and sort by `history.timestamp`. An index is created on `history.status`. What is the most accurate statement about this index?
Medium114You are optimizing a query: db.orders.find({ status: 'urgent', amount: { $gt: 500 } }).sort({ order_date: -1 }). According to the ESR (Equality, Sort, Range) rule, what is the ideal index for this query?
Hard115You are managing a MongoDB collection that stores sensor data. Each document has a `timestamp` field and a `sensorId` field. The collection is very large, and you need to optimize a query that finds the most recent reading for a specific sensor. The query is: `db.sensors.find({ sensorId: 'abc123' }).sort({ timestamp: -1 }).limit(1)`. Which index would best support this query?
Hard116Which schema pattern is demonstrated in the exhibit provided?
Medium117What happens if a $sort stage exceeds the 100MB RAM limit without an index?
Hard118You are designing indexes for a MongoDB collection that stores user profiles. The collection has a field 'email' that must be unique, and a field 'username' that is also unique. You also need to support queries that find users by a combination of 'country' and 'city'. Which TWO of the following statements are correct regarding index creation and behavior in this scenario? (Choose two.)
Medium119A social media platform stores user profiles in a `users` collection. Each user document includes a `followers` array of user IDs. For highly popular accounts, this array has grown to over 2 million entries, causing documents to approach the 16 MB BSON limit and slowing read operations. The application frequently displays a user's follower count and the first 20 followers. Which schema design change best addresses this issue?
Medium120What is the primary consequence of having too many indexes on a collection that experiences a high volume of write operations?
Hard121A retail catalog team stores each product as a document. Products share core fields such as sku, name, and price, but electronics carry warrantyMonths while apparel carries sizeChart. The application queries all products uniformly by category and price. Which modeling approach best fits this requirement?
Easy122A developer is working with a MongoDB collection that has a partial index defined as `db.products.createIndex({ price: 1 }, { partialFilterExpression: { price: { $gt: 100 } } })`. The developer runs a query `db.products.find({ price: { $lt: 50 } })`. Which of the following statements describes how MongoDB will execute this query?
Medium123A MongoDB collection contains documents with a field `tags` that is an array of strings. A developer creates an index on the `tags` field. Which of the following statements is true about the resulting index?
Medium124An analyst needs a pipeline that reads from a `sales` collection and, for each document, emits one output document per entry in the `regions` array, copying all other fields unchanged. Which stage accomplishes this?
Easy125Which property of a Multikey Index is true when indexing an array field?
Medium126You are designing a schema for a social media platform where users have an array of 'tags' and an array of 'mentions'. You attempt to create an index on { tags: 1, mentions: 1 }. What is the most likely outcome of this operation?
Medium127Your application executes the query: db.users.find({ age: { $gt: 30 } }, { age: 1, _id: 0 }). You have an index on { age: 1 }. How does MongoDB process this query?
Medium128A developer is querying the 'events' collection to retrieve documents and needs to control which fields are returned to reduce network payload. Which two statements about projection in MongoDB find() operations are correct? (Choose two.)
Medium129Which TWO of the following are benefits of using the Polymorphic Pattern in MongoDB?
Medium130An aggregation pipeline processes a collection of sensor readings with fields `sensorId`, `timestamp`, and `value`. The pipeline must output, for each sensor, the most recent reading's value and the average value across all readings. Which pipeline correctly achieves this?
Hard131A developer is using the MongoDB Node.js driver to perform a multi-document transaction that includes a read operation on a collection with a read concern of 'snapshot'. What is the effect of using 'snapshot' read concern in this transaction?
Hard132A developer is working with a collection that has a compound index on { a: 1, b: 1, c: 1 }. They run a query that includes a filter on `a` and a sort on `c`. The query is: `db.collection.find({ a: 5 }).sort({ c: 1 })`. Which of the following best describes how MongoDB will execute this query?
Hard133Refer to the exhibit. Which MongoDB design pattern is represented here?
Hard134What is the purpose of the $merge stage in an aggregation pipeline?
Medium135You are designing a schema for a social media platform. A user has a 'profile' document, and they can have thousands of 'followers'. How should you model the follower relationship?
Medium136A 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?
Medium137Which operator is used to calculate the average value of a numeric field in a $group stage?
Easy138A team is designing a schema for a product catalog where different product categories have entirely different attributes: books have ISBN and page count, electronics have wattage and warranty period, and clothing has size and material. All products must be searchable in a single query by name. Which data modeling approach best fits this requirement?
Easy139A developer wants to implement full-text search on a collection of articles. They create a text index on the 'content' field. Which of the following is a significant limitation of 'text' indexes in MongoDB?
Medium140A logistics MongoDB deployment has a 'shipments' collection. A nightly job must remove the 'tracking_history' array element whose 'status' is 'cancelled' from every document where 'carrier' is 'DHL', without deleting the documents themselves. Which update operation should the developer run?
Medium141When designing a schema for a blog application, you need to store comments for posts. The comments grow indefinitely. Which approach is most effective for long-term scalability?
Medium142An IoT platform ingests temperature readings from thousands of sensors. Each reading is currently stored as its own document with sensorId, timestamp, and value, producing millions of tiny documents per day. Queries typically retrieve readings for a sensor over a specific hour. Which schema design most improves storage efficiency and query performance for this access pattern?
Hard143A banking application must atomically transfer funds between two account documents in the 'accounts' collection. The transfer decreases the balance of the source account and increases the balance of the destination account, and both changes must succeed or neither should be applied. The deployment is a replica set. Which approach guarantees this atomicity?
Hard144A social media application stores user posts. Each post document currently embeds a comments array. A single popular post can accumulate over 50,000 comments, causing the document to grow beyond 10 MB. The development team wants to avoid hitting the 16 MB document size limit while still being able to retrieve a post with its most recent 10 comments in a single query. Which schema design should they implement?
Medium145A logistics application stores shipment records in the 'shipments' collection. A developer must delete all shipment documents whose 'status' field equals 'cancelled'. Which command correctly performs this operation?
Easy146Which operator would you use to filter for documents where an array field contains ALL of the elements in a specified array?
Medium147A 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?
Hard148A developer wants to run ad-hoc queries against a MongoDB Atlas cluster from a terminal, including commands like db.collection.find() and db.adminCommand({listDatabases: 1}). The developer has the connection string and wants the least additional setup. Which tool should be used?
Medium149Which of the following describes the behavior of a 'write concern' in a MongoDB transaction?
Medium150An 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?
Hard151When designing a schema for a one-to-many relationship, what is the primary factor in deciding between embedding and referencing?
Easy152A team is deciding how to model the relationship between orders and the products each order contains. They want to optimize for the common query that retrieves an order along with the name and current price of every product in it. Which two modeling considerations best support this requirement? (Choose two.)
Medium153A logistics company stores shipment documents in a collection named shipments. Each document has fields: `origin` (string), `destination` (string), `weight` (number), and `status` (string). The analytics team wants to find the total weight of shipments for each unique pair of origin and destination, but only for shipments with status 'delivered'. They also want to include the average weight per pair and sort the results by total weight descending. Which two stages are essential to achieve the grouping and calculation of these metrics? (Choose two.)
Medium154A financial analytics collection stores documents with fields 'accountId' (string), 'transactionDate' (date), and 'amount' (decimal). A common query is: db.transactions.find({ accountId: 'A123', transactionDate: { $gte: ISODate('2024-01-01'), $lte: ISODate('2024-01-31') }, amount: { $gt: 1000 } }). You need an index that supports this query efficiently. Following the ESR rule, which index key pattern is optimal?
Hard155A document in the 'profiles' collection has an embedded array 'contacts' of subdocuments, each with 'type' and 'value' fields. A developer must change the 'value' of the subdocument whose 'type' is 'email' without altering any other array element. Which update is correct?
Hard156You are considering using a hashed index for a 'product_id' field to distribute data across shards. Which of the following is a known limitation of hashed indexes in MongoDB?
Easy157A developer is reviewing the characteristics of MongoDB documents. Which two of the following statements are accurate? (Choose two.)
Medium158When should you use the 'Computed Pattern' in MongoDB?
Hard159You are reviewing an aggregation pipeline on an `orders` collection that must return only orders with a `total` greater than 100 and then compute the number of orders per `customerId`. The collection has an index on `total`. Which two stages should you use, and in what order, to maximize performance while returning the correct results? (Choose two.)
Hard160A social application stores posts with an embedded array of likes containing userId values. Some posts have millions of likes. The team wants to keep post documents small and still answer questions such as whether a specific user liked a post and how many likes a post has. Which two design changes best meet these goals? (Choose two.)
Hard161A 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.)
Medium162Which document design pattern should be used to store a one-to-many relationship where the child documents are frequently accessed together with the parent?
Medium163A developer is writing a Node.js application that must execute a series of document updates across two collections atomically. The application uses the MongoDB Node.js driver and needs to ensure that if any operation fails, all changes are rolled back. Which driver API should the developer use to achieve this?
Medium164A developer is writing a Python application using the official MongoDB driver to insert a single document into the 'inventory' collection. They call `inventory.insert_one({'sku': 'A100', 'qty': 5})`. Which statement accurately describes what happens?
Medium165Which TWO of the following scenarios are best suited for using the 'Subset Pattern' in MongoDB?
Medium166Refer to the exhibit. If a query is executed as db.collection.find({ "metadata.type": "book" }), how will MongoDB use the created index?
Medium167An application needs to update a user document in the 'users' collection. If the document does not exist, a new document must be inserted using fields from both the filter and the update document. Which parameter accomplishes this behavior in MongoDB?
Medium168A team stores user profiles in a `profiles` collection. About 90% of documents have a `deletedAt` field set to null, and only 10% have an actual timestamp indicating soft deletion. Queries that list active users filter on `deletedAt: null` and sort by `createdAt`. The team wants an index that stays small and avoids maintaining entries for deleted documents. Which index definition best matches this requirement?
Easy169Which TWO of the following statements regarding the ESR rule for index creation are true?
Medium170Which stage would you use to limit the output of your aggregation to the top 10 most expensive items?
Easy171A 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?
Hard172A 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?
Medium173An e-commerce application models product reviews inside an array on the product document. As popular products accumulate hundreds of thousands of reviews, write operations and document fetch operations experience performance degradation. Which data modeling pattern best resolves this issue?
Medium174When designing a document model, which factor is most important for determining whether to embed or reference data?
Easy175A social media platform stores each user's 'followers' as an array of ObjectIds inside the user document. Analytics shows that a small number of celebrity accounts have millions of followers, and these documents are approaching the 16MB BSON limit. Which schema pattern should a MongoDB developer apply to resolve this issue?
Medium176A logistics application stores shipment events in the 'shipments' collection. Each document contains a field 'events' that is an array of subdocuments with fields 'status' and 'timestamp'. You need to remove the subdocument where 'status' equals 'cancelled' from all documents in the collection, without affecting other array elements. Which update operation should you use?
Medium177You are troubleshooting a pipeline over a large `telemetry` collection that exceeds the aggregation memory limit while running on a single mongod instance. You must let the pipeline complete successfully without changing the server-wide configuration. Which two actions will allow the pipeline to keep running? (Choose two.)
Hard178A logistics company uses MongoDB to store shipment data. Each shipment document includes a status field that can be one of several values: 'pending', 'in_transit', 'delivered', 'cancelled'. The application frequently queries shipments by status and also needs to generate reports that count shipments per status. The team wants to ensure efficient queries and minimal index overhead. Which schema design consideration is most important?
Medium179What is the primary role of the 'mongos' process in a sharded cluster?
Medium180Refer to the exhibit. What is the expected behavior if the 'price' field exists but the 'tax' field is missing in a document?
Hard181Which aggregation stage allows you to replace the root of the document with a specified document or field?
Medium182A financial application stores account documents with an embedded array of transactions. The array is unbounded and documents have reached 8MB. Auditors require a complete, ordered history of every transaction. Which approach best preserves full history while keeping account documents within size limits?
Hard183An e-commerce application stores orders in an `orders` collection. Each order document contains an array of `items`, with each item having `productId`, `quantity`, and `price`. The application needs to frequently generate reports that sum the total revenue per product across all orders. Which schema design or feature best supports this requirement efficiently?
Medium184A mobile banking app stores each customer's account document with an embedded array of the last 20 transactions for quick display, while the full transaction history lives in a separate transactions collection. Which data modeling consideration most directly justifies this split?
Easy185A 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?
Hard186A developer is configuring an Atlas Search index on a collection of product documents. The index definition uses a dynamic mapping. Which two statements accurately describe the behavior or configuration of Atlas Search indexes in this scenario? (Choose two.)
Hard187You have a collection of sensor readings where each document includes a timestamp field `recordedAt` and a temperature field `tempC`. You need to generate a report that groups readings into 15-minute intervals and calculates the average temperature per interval. Which aggregation expression should you use to create the grouping key?
Medium188You are storing GPS coordinates in a 'locations' collection using GeoJSON format. You need to perform queries that find points within a specific polygon. Which index type must be created on the location field?
Medium189You are modeling an IoT telemetry system in MongoDB. Each sensor device emits a reading every 5 seconds, and the application most often queries the last 24 hours of readings for a single device. You want to minimize the number of index entries and document reads per query. Which schema design should you choose?
Medium190A 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?
Medium191Why does using a $limit stage immediately after a $sort stage provide a performance advantage?
Medium192A developer is exploring a 'reviews' collection and wants to retrieve only the 'author' and 'rating' fields from every review document, without the _id field, to reduce the payload sent to the application. Which query accomplishes this?
Easy193A support ticketing system stores documents in the 'tickets' collection. An operator wants to add a new field 'priority' set to 'high' only for tickets whose 'status' is 'open' and that do not already have a 'priority' field. The update must not create any new documents and must not modify tickets that already have a 'priority' field. Which update operation should be used?
Medium194Which of the following describes the behavior of the BSON format within MongoDB?
Easy195A development team is designing a schema for an e-commerce application that stores product data. Products have a set of core fields (name, price, description) that are common to all products, but different product categories have unique attributes (e.g., 'screen_size' for electronics, 'fabric' for clothing). Queries often filter on these category-specific attributes. The team wants a flexible schema that supports efficient queries on any attribute. Which TWO of the following design approaches are most appropriate? (Choose two.)
Hard196What is the primary benefit of using $unionWith to combine data from two collections in a single pipeline?
Medium197An IoT platform stores sensor readings in a collection `readings` with fields `deviceId`, `timestamp`, and `value`. The collection is large and grows continuously. Queries typically retrieve the most recent readings for a specific device, filtering by `deviceId` and sorting by `timestamp` descending. The operations team wants to minimize index size while still supporting these queries efficiently. Which index strategy best meets this requirement?
Medium198Refer to the exhibit. Why is this pipeline considered suboptimal?
Medium199A 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?
Medium200What happens if a document grows beyond the 16MB limit due to an 'Embedding' design choice?
Medium201A 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?
Medium202A team is designing a schema for a MongoDB application that stores user profiles. Each profile includes a list of the user's favorite movies, which is typically fewer than 20 items and updated infrequently. Queries often retrieve the entire profile along with the favorite movies. Which data modeling approach is most appropriate?
Easy203What is the primary advantage of the Subset pattern in MongoDB data modeling?
Medium204In the context of the MongoDB Node.js driver, what happens if an application fails to provide a write concern?
Medium205A logistics application stores shipment documents. Each shipment references a carrier by carrierId. Carriers are a small, slow-changing set (about 40 documents) that the application joins on nearly every shipment view. Which design decision is most appropriate for the carrier reference?
Hard206An application queries a users collection with db.users.find({ email: "a@b.com" }). The collection holds about 2 million documents, and the email field is unique for every user. A developer proposes creating an index { email: 1, country: 1 } to speed up the query. What is the most accurate assessment of this proposal?
Hard207A developer needs to run a multi-document transaction using the MongoDB Node.js driver. The transaction must read from the 'orders' collection and write to the 'inventory' collection. Which sequence of operations correctly implements the transaction?
Medium208Which of the following describes the behavior of a 'causally consistent' session in MongoDB?
Medium209An e-commerce application stores products with fluctuating attributes. Which data modeling pattern is most effective for handling diverse product schemas while maintaining efficient filtering?
Medium210A developer needs to calculate the total revenue per product category from a sales collection. The collection has documents with fields `category` and `amount`. Which aggregation pipeline stage should be used to compute the sum of amounts for each category?
Easy211Which of the following describes the 'Extended Reference' pattern and its primary use case?
Medium212An application using the MongoDB Node.js driver must ensure that a multi-document transaction is retried correctly when it encounters a transient error. Which two practices are required? (Choose two.)
Medium213Which of the following best describes the purpose of the MongoDB 'mongosh' shell?
Easy214A reporting service reads from the 'sensors' collection, which holds millions of documents each containing an 'active' boolean field. The service queries only for documents where 'active' is true and reads a handful of fields. A developer wants the query to avoid scanning documents that are inactive. Which index should be created to support this access pattern most directly?
Easy215A social media platform stores each user's followers as an array of ObjectIds inside the user document. Power users can have millions of followers, and the application frequently needs to paginate through the follower list and display total counts. Which data modeling change best addresses the document growth and query performance concerns?
Medium216A logistics application stores shipment records in a collection named `shipments`. Each document includes a `status` field (e.g., "in_transit", "delivered") and a `delivery_date` field. The development team frequently runs a query that filters on `status` and sorts by `delivery_date` in ascending order. They want to create a compound index to optimize this query. Which index should they create?
Medium217A developer is using the MongoDB Node.js driver to perform a multi-document transaction that updates multiple collections. During testing, the transaction occasionally fails with a TransientTransactionError. What is the most appropriate way to handle this error?
Hard218Refer to the exhibit. You have a collection where each document contains a 'tags' array. If you frequently query for documents containing specific tags, what is the best way to model and index this data?
Hard219A team is modeling orders and customers. Orders are frequently displayed with basic customer details such as name and email, but customer profiles are large and change often. Which approach best balances read performance with avoiding duplication problems?
Medium220What is the primary benefit of the 'Bucket Pattern' in MongoDB data modeling?
Medium221A developer is using the MongoDB Node.js driver to perform a multi-document transaction that updates a document in the 'orders' collection and inserts a record into the 'audit' collection. After starting the session and transaction, the update succeeds, but the insert fails due to a duplicate key error. What should the developer do to handle this error and ensure data consistency?
Medium222Which TWO of the following scenarios are optimal for using the Embedding pattern instead of Referencing?
Medium223A developer is building a Node.js application that connects to a MongoDB replica set. The application must ensure that every read operation sees a consistent snapshot of the data, even if other clients are concurrently modifying documents. Which read concern level should be used for these reads?
Medium224An application writes documents to a `metrics` collection where each document contains an embedded array `samples` of subdocuments with fields `value` and `unit`. A query filters on `samples.unit` and `samples.value` together, expecting both conditions to match the same array element. The developer creates { "samples.unit": 1, "samples.value": 1 }. Which behavior should the developer expect from this index?
Hard225Which tool is primarily recommended for performing binary backups and restores of a MongoDB deployment?
Easy226A developer needs to quickly inspect the contents of a MongoDB collection and run ad-hoc queries during development. The developer prefers a command-line interface that supports JavaScript syntax and allows direct interaction with the database. Which MongoDB tool should be used?
Easy227A social media application stores user profiles with an embedded `friends` array containing friend IDs. The array can grow to thousands of entries. Queries frequently need to find mutual friends between two users. Which schema design strategy best optimizes this workload in MongoDB?
Hard228A retail company stores orders in a collection where each document has a `customerId` field and a `total` field. The analytics team needs to see, for each customer, both the sum of all order totals and a list of the individual order totals. Which aggregation pipeline stage and accumulator combination should be used?
Medium229A developer needs to load a large JSON file into a collection named 'inventory' in the 'retail' database on a MongoDB server running on localhost. The file contains one JSON document per line. Which command-line tool should be used?
Easy230Which of the following describes the 'schema-flexible' nature of MongoDB?
Easy231You are designing a schema for a social feed where each post has a small, bounded set of reactions (like, love, wow) that are always displayed together with the post, and a potentially very large set of comments that are paginated on demand. Which TWO design choices correctly apply MongoDB schema patterns to these requirements? (Choose two.)
Medium232What is the primary risk of using the 'Linking Pattern' improperly?
Medium233An e-commerce application frequently executes a query filtering by 'category' and 'brand', and then sorts the results by 'price' in ascending order. You created a compound index on { category: 1, brand: 1, price: 1 }. Which statement best describes how MongoDB utilizes this index for a query that filters only on 'brand' and 'price'?
Medium234A support team stores tickets in a `tickets` collection where each document has a `status` field that may be missing on legacy records. A developer runs a pipeline whose first stage is { $match: { status: { $ne: "closed" } } } and expects every non-closed ticket to appear in the results. Which set of documents does this stage pass downstream?
Medium235A developer is building an aggregation pipeline on a collection of blog posts. Each post document contains an array field `comments`, where each comment is an object with `author` and `text`. The developer needs to produce a separate document for each comment, preserving the post's `title` and the comment's `author` and `text`. Which TWO stages are required to achieve this? (Choose two.)
Medium236A 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?
Easy237You are aggregating a `logs` collection where each document has a `timestamp` and a `level` field. You need to produce a single document that contains two arrays: one with all `timestamp` values for `level: "ERROR"` and one with all `timestamp` values for `level: "WARN"`. Which pipeline should you use?
Hard238A developer is building an aggregation pipeline on a collection of sensor readings. The pipeline must group documents by sensorId and compute two values: the total number of readings and the timestamp of the most recent reading. Which $group accumulator pair should be used?
Medium239A developer needs to import a large JSON file into a MongoDB collection named 'products' in the 'catalog' database. The file contains one JSON document per line (JSON Lines format). Which MongoDB tool should be used to accomplish this efficiently?
Easy240When using MongoDB Compass to analyze query performance, which tool is most effectively used to view the explain plan output in a visual format?
Easy241A retail company stores order documents in a collection named orders. Each document has a field `total` (numeric) and a field `status` (string). The analytics team needs to produce a report that shows, for each `status`, the total revenue and the number of orders, but only for orders where `total` is greater than 100. The report must be sorted by total revenue in descending order. Which aggregation pipeline correctly produces this report?
Medium242A developer is tuning indexes on an `orders` collection. The team reports slow queries and heavy write latency, and they suspect too many indexes. Which TWO practices should the developer apply when reviewing the index set? (Choose two.)
Medium243A developer queries the 'events' collection with db.events.find({ tags: { $in: ["sports", "music"] } }) and observes a COLLSCAN in explain output even though an index exists on the 'tags' array field. The collection holds a few hundred documents. Which explanation best accounts for the planner choosing a collection scan?
Hard244You have a collection of user activity logs where queries frequently filter by `userId` and sort by `timestamp` in descending order. Which single index definition provides optimal support for this query pattern without requiring an in-memory sort?
Medium245A blog platform stores posts in the 'posts' collection. Each document has an array field 'comments' containing subdocuments with fields 'author' and 'text'. You need to add a new comment to the 'comments' array of a specific post identified by its '_id'. The new comment should be appended to the end of the array. Which update operation should you use?
Hard246A developer needs to create an Atlas Search index that supports autocomplete on a `name` field. Which Atlas Search index definition is required?
Easy247A 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?
Easy248A collection 'logs' has a TTL index on the 'createdAt' field with expireAfterSeconds set to 3600. A developer notices that some documents older than one hour are still present in the collection. Which explanation is most likely?
Medium249You are building an aggregation pipeline on a collection of sensor readings where each document has a `timestamp` field and a `value` field. You need to compute, for each calendar day, the highest `value` and the average `value` across all readings for that day. Which `$group` stage accomplishes this?
Medium250Which stage should be placed first in an aggregation pipeline to optimize performance when filtering a large collection based on an indexed field?
Medium251Refer to the exhibit. The document uses the Attribute Pattern. Why is this model superior for indexing compared to storing specs as a single sub-document `{ RAM: '16GB', CPU: 'i7' }`?
Hard252A 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?
Medium253An application uses a multi-document transaction to update inventory and process an order. What happens if the transaction exceeds the default transaction lifetime limit of 60 seconds?
Medium254A developer wants to remove all documents from the 'logs' collection where the 'level' field equals 'debug'. The collection has an index on level. Which operation should be used, and what does it return?
Easy255A financial application stores transactions in the 'transactions' collection. Each document has fields: 'accountId', 'amount', 'timestamp', and 'status'. You need to find all transactions for account 'A123' that have an amount greater than 1000 and a status of either 'pending' or 'review'. Which two query documents correctly retrieve these transactions? (Choose two.)
Hard256A developer must update a document in the 'accounts' collection by incrementing the 'balance' field by 25 and simultaneously setting the 'lastUpdated' field to the current date. The update must apply only if the account is active. Which update statement satisfies all conditions?
Hard257You are the lead developer for a high-traffic e-commerce application using MongoDB 6.0. A query on the `orders` collection that filters on `customerId` and sorts by `orderDate` in descending order is performing poorly. You decide to create an index to improve its performance. Which of the following indexes would be most efficient for this query?
Medium258A support team frequently runs a query that filters on status and sorts by created_at, both fields in the same collection. An existing index { status: 1 } is in place, but the query still performs an in-memory sort and gets killed once result sets grow past the 100 MB sort limit. Which index should you create to let the server satisfy both the filter and the sort without a blocking sort stage?
Medium259A developer is working with a collection that stores user profiles. The collection has an index on the `email` field. The developer runs a query that uses a regular expression to find all users whose email ends with "@example.com". The query is: `db.users.find({ email: /@example\.com$/ })`. What is the most likely behavior of this query with respect to the index?
EasyOther domains
All C100DEV exam domains
Frequently asked questions
- What does the scenario questions domain cover on the C100DEV exam?
- scenario questions questions test whether you can apply the concept in context, not just recognise a definition.
- How many questions are in this domain?
- This page lists all 259 scenario questions 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 scenario questions questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.