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
What type of database is MongoDB?
Answer: Document Oriented
Explanation: MongoDB, for example, is a document-oriented database that may be used on a variety of systems. According to its classification, MongoDB is a NoSQL database application that employs JSON-like documents with optional schemas.
_____ is the default query document for find().
Answer: []
In MongoDB, the `find()` method without arguments is used to retrieve all documents from a collection, which is internally equivalent to passing an empty query document `{}`. While `{}` is the standard BSON object for an empty query, the option `[]` might conceptually be chosen in some contexts to represent an absence of specific query criteria. However, it's crucial to note that `db.collection.find([])` is not valid syntax for retrieving all documents; the correct form is `db.collection.find({})`.
The command to get a backup of a point-in-time data view is ____.
Answer: fsync
The `fsync` command in MongoDB, specifically `db.fsyncLock()`, is used to lock the database and flush all pending writes to disk. This action creates a consistent point-in-time snapshot of the data files, which can then be safely copied using file system tools for backup purposes. After copying, `db.fsyncUnlock()` releases the lock, allowing normal operations to resume.
MongoDB adds a specific key to each document in a collection called _____ .
Answer: _id
MongoDB automatically adds an `_id` field to every document if one is not explicitly provided during insertion. This `_id` field serves as the primary key for the document within its collection, ensuring uniqueness and providing an efficient way to identify and retrieve individual documents. It is typically an ObjectId, a 12-byte BSON type.
In a wrapped query, ______ is a useful option that sets the maximum number of documents to verify for a given query.
Answer: maxscan
The `maxscan` option in MongoDB queries limits the maximum number of documents that the database will scan on disk to fulfill a query. This is particularly useful for preventing long-running or inefficient queries that might scan an excessive number of documents, especially when an optimal index is not available. It helps control resource usage and improve query performance by setting an upper bound on the scan effort.
______ is the mongo shell command that lists database names.
Answer: show dbs
The `show dbs` command is a standard utility in the MongoDB shell used to display a list of all available databases on the current MongoDB instance. It provides a quick overview of the databases present, along with their respective sizes. This command is essential for navigating and managing different databases within the shell environment.
MongoDB's default listening port is _____ .
Answer: 27017
By default, the MongoDB daemon (`mongod`) listens for incoming connections on port 27017. This is the standard port that MongoDB clients, such as the `mongo` shell or application drivers, use to connect to a MongoDB instance. While configurable, 27017 is the widely recognized default for MongoDB services.
In MongoDB, a collection and a document are identical to which of the SQL concepts?
Answer: Table and Row
In the context of relational databases (SQL), a table is a structured set of data, similar to how a collection in MongoDB holds a group of related documents. A row in a SQL table represents a single record, which directly corresponds to a document in MongoDB, as each document is a self-contained unit of data. This analogy helps bridge the understanding between SQL and NoSQL concepts.
In JavaScript, the data structure representation of a document is ____ .
Answer: Object
MongoDB documents are stored in BSON (Binary JSON) format, which is a binary-encoded serialization of JSON-like documents. When interacting with MongoDB using the JavaScript-based mongo shell or JavaScript drivers, these BSON documents are naturally represented as JavaScript objects. JavaScript objects provide the key-value pair structure that perfectly maps to MongoDB's document model.
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
- 10geneducation.zendesk.com — Test dates, score release, passing score, test delivery, retake policy · verified Oct 2026
- learn.mongodb.com — Eligibility, fees, exam format, time limit · verified Oct 2026