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
  1. What problem does the Computed Pattern solve in MongoDB? It pre-computes and stores results that are expensive to calculate on every read
  2. Which operator selects documents where a field value matches any value in a specified array? $in
  3. What is horizontal scaling in MongoDB achieved through? Sharding data across multiple servers
  4. How many votes are needed for a primary election in a MongoDB replica set? A simple majority of all voting members
  5. Which write concern provides the lowest durability but the highest write throughput in MongoDB? { w: 0 }
  6. What type of database is MongoDB? Document Oriented
  7. What is the 'outlier pattern' in MongoDB data modeling used for? Handling documents whose arrays would exceed the size limit by using overflow documents
  8. What is a partial index in MongoDB? An index that only includes documents meeting a specified filter expression
  9. What does the mongotop tool monitor in MongoDB? Time spent reading and writing data per collection
  10. Which field is automatically created by MongoDB for every document if not explicitly provided? _id
  11. What is the correct MongoDB syntax to sort query results in descending order by a field named 'score'? .sort({score: -1})
  12. What is the Atlas connection string format used by application drivers? mongodb+srv://username:password@cluster.mongodb.net/dbname
  13. In a wrapped query, ______ is a useful option that sets the maximum number of documents to verify for a given query. maxscan
  14. The command to get a backup of a point-in-time data view is ____. fsync
  15. How do you limit the number of documents returned by a MongoDB query? .limit(n)
  16. What is the purpose of the mongoexport tool? Exports MongoDB data to a CSV or JSON text format
  17. Which of the following is a recommended characteristic of a good shard key? High cardinality and even distribution of values to prevent hot spots
  18. What does the $type operator do in a MongoDB query? Matches documents where a field is of a specified BSON type
  19. How do you apply a projection in a MongoDB find() query to return only specific fields? db.col.find({filter}, {field: 1})
  20. What is an Atlas cluster tier (M0, M10, M30, etc.)? A predefined configuration defining CPU, RAM, and storage resources for the cluster
  21. What is MongoDB's Ops Manager used for? On-premises deployment management, monitoring, backup, and automation for MongoDB
  22. What is zone sharding (also called tag-aware sharding) in MongoDB? Associating ranges of shard key values with specific shards to control data placement
  23. What is the Tree Pattern used for in MongoDB? Representing hierarchical data such as organizational charts or category trees
  24. Which MongoDB feature enforces that fields meet specific data type requirements? Schema validation with $jsonSchema
  25. What does the replaceOne() method do differently from updateOne()? It replaces the entire document except _id rather than updating specific fields
  26. What does mongos do in a MongoDB sharded cluster? Acts as a query router, directing client operations to the appropriate shards
  27. What happens to indexes when a MongoDB collection is dropped? All indexes on the collection are automatically deleted
  28. What is a hashed index used for in MongoDB? Enabling hash-based sharding by hashing field values
  29. 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
  30. In JavaScript, the data structure representation of a document is ____ . Object