← All MongoDB Flashcard Decks

Test Flashcards

9 cards from real MongoDB practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 9 Test flashcards as text
  1. Which mode does the explain() command operate in by default?

    Answer: queryPlanner

    The `explain()` command in MongoDB provides detailed information about how the database executes a query. By default, it operates in `queryPlanner` mode, which shows the query optimizer's chosen plan without actually executing the query. This mode is useful for understanding index usage and potential performance issues without incurring the overhead of full query execution.

  2. The master's oplog uses the ____ storage size measure .

    Answer: MB

    The oplog (operation log) in MongoDB is a special capped collection that records all data-modifying operations on a primary replica set member. Its size is typically configured in megabytes (MB) and is crucial for replication, as secondary members apply operations from the primary's oplog to stay synchronized. A sufficiently large oplog is necessary to prevent secondaries from falling too far behind.

  3. The $inc key modifier acts with the _____ data type.

    Answer: numeric

    The `$inc` update operator in MongoDB is specifically designed to increment or decrement the value of a field by a specified amount. This operation is exclusively applicable to numeric data types, such as integers, doubles, or decimals. If `$inc` is applied to a non-numeric field, it will result in an error or unexpected behavior, as it performs arithmetic addition.

  4. $push is an array operator that adds a key to an array at the ______.

    Answer: End

    The `$push` operator in MongoDB is used to append a specified value to an array field within a document. When `$push` is applied, the new element is added to the end of the existing array. This makes it a straightforward way to grow an array by adding new items sequentially.

  5. Which of the following commands has the potential to lock the database?

    Answer: All of the above

    In earlier versions of MongoDB, many operations, including queries, inserts, and map-reduce jobs, could acquire database-level or collection-level locks. While modern MongoDB with the WiredTiger storage engine offers much finer-grained concurrency (document-level locking), certain administrative commands or very large operations can still escalate to higher-level locks. Therefore, all listed operations have the potential to involve locking mechanisms that could impact concurrent operations.

  6. Which of the following statements concerning sharding is correct?

    Answer: Once a shard key is put up, we can't alter it directly or automatically.

    The shard key is a critical component of a sharded cluster, determining how data is distributed across shards. Once a shard key is defined for a collection, it cannot be directly changed or modified. Altering a shard key typically requires a complex migration process, often involving dumping the data, dropping the collection, and re-inserting it with a new shard key.

  7. What is the largest Index Key Limit and Number of Indexes per collection?

    Answer: 1024 bytes and 64 indexes

    MongoDB imposes certain limits on indexes to ensure performance and manageability. An index key cannot exceed 1024 bytes in size, and a single collection is limited to a maximum of 64 indexes. These limits help prevent overly complex or inefficient indexing strategies that could degrade database performance and increase memory usage.

  8. What is the maximum document size in MongoDB?

    Answer: 16MB

    MongoDB documents have a maximum size limit of 16 megabytes (MB). This limit is in place to prevent excessively large documents from consuming too much RAM or disk space, which could negatively impact performance and replication efficiency. For data exceeding this limit, MongoDB recommends using GridFS to store files.

  9. The mongoimport command is used to do the:

    Answer: imports content from an Extended JSON, CSV, or TSV export created by mongoexport

    The `mongoimport` utility is a command-line tool specifically designed to import data from various file formats into a MongoDB collection. It commonly handles Extended JSON, CSV (Comma Separated Values), and TSV (Tab Separated Values) files, making it ideal for loading data that was previously exported by `mongoexport` or generated by other systems. It facilitates bulk data loading into MongoDB.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. 10geneducation.zendesk.com — Test dates, score release, passing score, test delivery, retake policy · verified Oct 2026
  2. learn.mongodb.com — Eligibility, fees, exam format, time limit · verified Oct 2026