Recall & Review
beginner
What is a collection in MongoDB?
A collection in MongoDB is like a folder that holds many documents. It is similar to a table in a traditional database but stores data in flexible, JSON-like documents.
Click to reveal answer
beginner
How does a table in SQL differ from a collection in MongoDB?
A table in SQL has a fixed schema with rows and columns, while a MongoDB collection stores documents that can have different structures and fields.
Click to reveal answer
beginner
Why is a MongoDB collection compared to a folder in real life?
Because just like a folder holds many files, a collection holds many documents. Each document can be different, just like files can be different types.
Click to reveal answer
beginner
Can documents in the same MongoDB collection have different fields?
Yes, documents in the same collection can have different fields and structures, unlike rows in a SQL table which must follow the same columns.
Click to reveal answer
intermediate
What is the main advantage of collections over tables in terms of data structure?
Collections allow flexible and dynamic data structures, so you can store different types of data together without needing to define a strict schema upfront.
Click to reveal answer
In MongoDB, what is the closest equivalent to a SQL table?
✗ Incorrect
A collection in MongoDB is similar to a table in SQL because it groups many documents together.
Which of the following is true about MongoDB collections?
✗ Incorrect
MongoDB collections store documents that can have different fields and structures.
What is a good real-life analogy for a MongoDB collection?
✗ Incorrect
A collection is like a folder that holds many documents (files).
Which statement best describes a SQL table compared to a MongoDB collection?
✗ Incorrect
SQL tables have fixed columns, while MongoDB collections allow documents with different structures.
Why might someone choose a MongoDB collection over a SQL table?
✗ Incorrect
MongoDB collections are chosen for their flexibility in storing documents with different fields and structures.
Explain the mental model comparing MongoDB collections and SQL tables.
Think about how files in a folder can be different, but rows in a spreadsheet follow the same columns.
You got /4 concepts.
Describe the main difference in data structure flexibility between collections and tables.
Consider how MongoDB handles data compared to traditional SQL databases.
You got /4 concepts.