Chapter Review and Readiness Check
You have now learned the basic vocabulary and mental model required for the rest of the course.
Before moving forward, make sure you can explain the following concepts without relying on memorized definitions:
- Why MongoDB is described as a document database.
- How deployments, databases, collections, and documents relate to one another.
- How arrays and embedded documents represent structured application data.
- Why BSON is different from plain JSON.
- Why a flexible schema does not remove the need for validation.
- How to connect to a deployment using
mongosh. - How to insert documents and retrieve them with
find(). - How to filter on a nested field using dot notation.
- How a projection changes the returned fields.
- Why document growth and access patterns matter to data modeling.
Readiness exercise
Create a collection called students with at least four documents. Each document should contain a name, a numeric age, an array of enrolled subjects, and a nested address document. Include at least one optional field, such as scholarship or graduationYear.
Then write queries to:
- Retrieve all students.
- Find students older than 20.
- Find students enrolled in
Mathematics. - Find students from a particular city using dot notation.
- Return only student names and ages.
- Find documents where the optional field does not exist.
Finally, explain what might happen if different application services store ages as different BSON types.
What comes next
The next chapter should focus on MongoDB installation, deployment setup, connection strings, mongosh configuration, database and collection creation, and a repeatable development environment. This will establish the foundation for the CRUD operations and querying chapters that follow.
- MongoDB organizes data into databases, collections, and documents.
- Document structure should be designed around real application access patterns.
- BSON types affect query behavior and data consistency.
- Schema validation helps maintain data quality.
- Hands-on practice is essential before progressing to advanced querying.
Which issue can occur when one service stores `age` as a number and another stores it as a string?