---
title: "MongoDB: NoSQL Database Fundamentals"
description: "Master NoSQL fundamentals, BSON document structure, and the MongoDB aggregation pipeline."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/mongodb-nosql-fundamentals-quiz
---

# MongoDB: NoSQL Database Fundamentals

Welcome to the MongoDB Basics Quiz! NoSQL databases changed the way we handle modern web scale data. Understanding the document model, the flexibility of BSON, and the aggregation pipeline matters for any modern developer or DevOps professional. Let's see how much you know about the most widely used document store today!

## Questions

### 1. What type of NoSQL database is MongoDB?

- Key-Value store
- Document-oriented
- Graph database
- Column-family store

**Hint:** Think about how data is stored.

### 2. What does "BSON" stand for in MongoDB?

- Base Serialized Object Notation
- Binary JSON
- Boolean Serialized Object Network
- Buffered Standard Object Notation

**Hint:** The binary version of a popular format.

### 3. In MongoDB, what is the equivalent of a SQL "Table"?

- Database
- Collection
- Document
- Field

**Hint:** A group of documents.

### 4. What is the purpose of the unique "_id" field in a document?

- To encrypt the sensitive fields within the document
- To act as a unique Primary Key for the document
- To index the document for full-text search engines
- To track the total number of versions of a document

**Hint:** Every document needs one.

### 5. Which command is used to insert a single document into a collection?

- db.collection.add()
- db.collection.insertOne()
- db.collection.put()
- db.collection.create()

**Hint:** Basic CRUD.

### 6. What does "Schema-less" mean in the context of MongoDB?

- The database does not require an underlying storage engine
- Documents in a collection can have different fields and structures
- The database cannot be queried using traditional logical operators
- All data is stored in memory without being written to a disk

**Hint:** Flexible structure.

### 7. Which operator is used to filter results where a value is greater than a number?

- $gt
- $gte
- $high
- $max

**Hint:** Short for Greater Than.

### 8. What is the "Aggregation Pipeline"?

- A backup utility for exporting collections to external files
- A framework for data processing through multiple stages
- A tool for performing real-time full-text searches across indices
- A specialized index for high-speed geospatial queries

**Hint:** Multi-stage processing.

### 9. Which aggregation stage is used to filter documents?

- $filter
- $match
- $where
- $find

**Hint:** Matches conditions.

### 10. What does the "$group" stage do in an aggregation pipeline?

- It sorts the output documents by a specified field
- It aggregates documents by a key and applies calculations
- It merges two separate collections into a single stream
- It creates a new collection based on the results of the pipeline

**Hint:** Summarizing data.

### 11. Which operator is used to update a specific field in a document?

- $update
- $set
- $put
- $assign

**Hint:** Assigning a value.

### 12. What is "Horizontal Scaling" (Sharding) in MongoDB?

- Adding more CPU and RAM to a single database server
- Distributing data across multiple machines for high throughput
- Replicating the same dataset across multiple backup nodes
- Splitting large documents into smaller individual collections

**Hint:** Spreading data across servers.

### 13. What is a "Replica Set"?

- A set of indices created to optimize a specific query
- A group of MongoDB instances maintaining the same data set
- A collection of documents used for testing new schemas
- A series of automated backups stored in a remote region

**Hint:** High Availability (HA).

### 14. Which command is used to find all documents in a collection?

- db.collection.search({})
- db.collection.find({})
- db.collection.all()
- db.collection.fetch()

**Hint:** Search.

### 15. What does the "$lookup" stage perform?

- It searches the collection for a specific string pattern
- It performs a left outer join to another collection
- It checks the system logs for database performance issues
- It validates the document structure against a schema

**Hint:** The NoSQL version of a Join.

### 16. How do you perform a "Delete" in MongoDB?

- db.collection.removeDocuments()
- db.collection.deleteMany({})
- db.collection.drop()
- db.collection.truncate()

**Hint:** Removing documents.

### 17. What is an "Index" in MongoDB?

- A log of all administrative changes made to the schema
- A data structure that improves the speed of retrieval
- A mapping of physical disk locations to document IDs
- A tool for managing user permissions and access levels

**Hint:** Speeding up reads.

### 18. What is the "$unwind" stage used for?

- To compress large documents to save storage space
- To output a document for each element in an array field
- To reverse the order of documents in a result set
- To remove a specific field from all documents

**Hint:** Dealing with arrays.

### 19. What is the "Primary" node in a Replica Set?

- The node with the highest hardware specifications
- The node that receives all write operations
- The node that is used exclusively for long-term backups
- The node that manages the sharding metadata

**Hint:** The leader.

### 20. Which operator is used to push an element into an array field?

- $add
- $push
- $append
- $insert

**Hint:** Adding to a list.

### 21. What is the purpose of the "sort()" method?

- To filter the results based on a logical condition
- To determine the order of returned matching documents
- To group identical documents into a single summary
- To limit the number of fields returned per document

**Hint:** Ordering results.

### 22. What is "Atlas" in the MongoDB ecosystem?

- A tool for visualizing the geographic location of nodes
- A fully managed cloud database service
- A command-line utility for database performance tuning
- A library for mapping Go structs to MongoDB documents

**Hint:** Cloud service.

### 23. Which stage is used to rename fields in an aggregation pipeline?

- $rename
- $project
- $reshape
- $map

**Hint:** Reshaping the output.

### 24. What does "TTL Index" stand for?

- Total Transaction Log
- Time To Live Index
- Transfer Table Level
- Tagged Terminal Layer

**Hint:** Automatic deletion.

### 25. What is a "Capped Collection"?

- A collection with a password-protected access layer
- A fixed-size collection that overwrites oldest entries
- A collection that prevents any new fields from being added
- A collection used exclusively for storing small binary files

**Hint:** Fixed size.

### 26. Which operator checks if a field exists in a document?

- $has
- $exists
- $is
- $check

**Hint:** Existence check.

### 27. What is the "Compass" tool?

- A terminal-based tool for exploring sharded clusters
- A graphical user interface for visualizing MongoDB data
- A migration tool for moving data from SQL to NoSQL
- A cloud-based dashboard for monitoring server uptime

**Hint:** GUI for MongoDB.

### 28. What does the "upsert" option do in an update operation?

- It creates a backup of the document before modifying it
- It creates a new document if no match is found
- It sorts the document fields in alphabetical order
- It prevents the document from being updated by others

**Hint:** Update or Insert.

### 29. Which command shows the performance statistics of a query?

- explain()
- analyze()
- profile()
- stats()

**Hint:** Analysing speed.

### 30. What is "Write Concern"?

- A diagnostic report detailing slow write operations
- A setting specifying the level of acknowledgment for writes
- A security policy that restricts write access to specific users
- A validation rule that checks data types during an insert

**Hint:** Confirmation of success.
