MongoDB & Mongoose learning roadmap.
Model documents and reason about indexes, queries, and consistency. Work through 6 modules, then use the connected questions to check what you can explain without the notes.
- STEP 1
Data modeling
- What are documents, collections, BSON and ObjectId? · 2 min
- Embedding & references · 2 min
- How do I model relationships and schema changes? · 2 min
- What is denormalization? · 2 min
Checkpoint: explain the ideas above with an example and a limitation before continuing.
- STEP 2
Indexes & query plans
- How do indexes help, and what do they cost? · 2 min
- What index types should I know? · 2 min
- What is the ESR rule? · 2 min
- What should I check in explain? · 2 min
Checkpoint: explain the ideas above with an example and a limitation before continuing.
- STEP 3
Aggregation
- How does an aggregation pipeline work? · 2 min
- What do lookup, unwind and facet do? · 2 min
- What do set, addFields, skip and count do? · 2 min
Checkpoint: explain the ideas above with an example and a limitation before continuing.
- STEP 4
Transactions & scaling
- When do I need a transaction? · 2 min
- Read concern vs write concern vs read preference? · 2 min
- Replication vs sharding: what is the difference? · 2 min
Checkpoint: explain the ideas above with an example and a limitation before continuing.
- STEP 5
Mongoose
- Schema vs model vs document in Mongoose? · 2 min
- Populate vs lean: what should I remember? · 2 min
- What are hooks, virtuals, instance methods and static methods? · 2 min
- Is Mongoose validation enough to protect data? · 2 min
Checkpoint: explain the ideas above with an example and a limitation before continuing.
- STEP 6
Query performance
- How do I fix slow aggregation, pagination or N+1 queries? · 2 min
- What is a simple aggregation example? · 2 min
Checkpoint: explain the ideas above with an example and a limitation before continuing.
Check your understanding
After the lessons, rehearse the 20 connected questions. Revisit the lesson when you cannot yet explain why the answer works.
Practice MongoDB & Mongoose Review the interview guide