MongoDB in Depth

Learn MongoDB from your first document to the data layer of a real app: documents and when they fit, queries and updates in mongosh and Compass, modeling,…

Updated

Module 1: Documents

Set up MongoDB, mongosh and Compass, store your first documents, and learn what a document is: fields and values, arrays, documents inside documents and the types they hold, where documents fit, and when a table fits better. Then store and query a recipe collection of your own.

Module 2: Queries

Ask the database questions: add many documents at once, find them with comparison and logical operators, reach into arrays and nested documents, choose the fields, sort and page the results, then change and delete documents safely. Then build a recipe search with filters.

Module 3: Modeling

Design the documents for a bike shop's online store: start from the questions the app asks, choose between embedding and referencing, use the common patterns, add schema validation, keep a checkout safe, and see honestly when a relational database is the better choice. Then model a store and explain each choice.

Module 4: Aggregation and Indexes

Turn a year of a bike shop's orders into reports with the aggregation pipeline: match, group, project, sort, unwind, look up related documents and group by month. Then make queries fast with indexes and prove it with explain(). Finish with a sales report made fast by the right index.

Module 5: MongoDB in an App

Put MongoDB behind an app: learn the little JavaScript a ready-made Express API uses, connect with the official Node.js driver, write a data layer with its errors and tests, then see the same work in Mongoose and C#, and what Azure Cosmos DB's MongoDB API changes. Finish with the data layer for a pet adoption site.