MongoDB Cheat Sheet 2026
The 30 highest-yield MongoDB facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
53 questions
75 min time limit
70.00% to pass
- What problem does the Computed Pattern solve in MongoDB? → It pre-computes and stores results that are expensive to calculate on every read
- Which operator selects documents where a field value matches any value in a specified array? → $in
- What is horizontal scaling in MongoDB achieved through? → Sharding data across multiple servers
- How many votes are needed for a primary election in a MongoDB replica set? → A simple majority of all voting members
- Which write concern provides the lowest durability but the highest write throughput in MongoDB? → { w: 0 }
- What type of database is MongoDB? → Document Oriented
- What is the 'outlier pattern' in MongoDB data modeling used for? → Handling documents whose arrays would exceed the size limit by using overflow documents
- What is a partial index in MongoDB? → An index that only includes documents meeting a specified filter expression
- What does the mongotop tool monitor in MongoDB? → Time spent reading and writing data per collection
- Which field is automatically created by MongoDB for every document if not explicitly provided? → _id
- What is the correct MongoDB syntax to sort query results in descending order by a field named 'score'? → .sort({score: -1})
- What is the Atlas connection string format used by application drivers? → mongodb+srv://username:password@cluster.mongodb.net/dbname
- In a wrapped query, ______ is a useful option that sets the maximum number of documents to verify for a given query. → maxscan
- The command to get a backup of a point-in-time data view is ____. → fsync
- How do you limit the number of documents returned by a MongoDB query? → .limit(n)
- What is the purpose of the mongoexport tool? → Exports MongoDB data to a CSV or JSON text format
- Which of the following is a recommended characteristic of a good shard key? → High cardinality and even distribution of values to prevent hot spots
- What does the $type operator do in a MongoDB query? → Matches documents where a field is of a specified BSON type
- How do you apply a projection in a MongoDB find() query to return only specific fields? → db.col.find({filter}, {field: 1})
- What is an Atlas cluster tier (M0, M10, M30, etc.)? → A predefined configuration defining CPU, RAM, and storage resources for the cluster
- What is MongoDB's Ops Manager used for? → On-premises deployment management, monitoring, backup, and automation for MongoDB
- What is zone sharding (also called tag-aware sharding) in MongoDB? → Associating ranges of shard key values with specific shards to control data placement
- What is the Tree Pattern used for in MongoDB? → Representing hierarchical data such as organizational charts or category trees
- Which MongoDB feature enforces that fields meet specific data type requirements? → Schema validation with $jsonSchema
- What does the replaceOne() method do differently from updateOne()? → It replaces the entire document except _id rather than updating specific fields
- What does mongos do in a MongoDB sharded cluster? → Acts as a query router, directing client operations to the appropriate shards
- What happens to indexes when a MongoDB collection is dropped? → All indexes on the collection are automatically deleted
- What is a hashed index used for in MongoDB? → Enabling hash-based sharding by hashing field values
- What happens to a replica set member whose oplog window is exceeded by replication lag? → It enters RECOVERING state and must be resynced from another member
- In JavaScript, the data structure representation of a document is ____ . → Object
Turn these facts into recall: