MongoDB Learning Labs Documentation

A structured, incremental learning path to master MongoDB — from document model fundamentals to sharding and security.

🚀 Getting Started

1. Start the MongoDB Cluster

cd docker && docker compose up -d
Starts a 3-node replica set (mongo1, mongo2, mongo3) + Mongo Express UI at http://localhost:8081.

2. Run a Lab

docker exec -it mongo1 mongosh --file /labs/01_database_basics.js

3. Interactive Shell

docker exec -it mongo1 mongosh
# or from host (requires mongosh installed):
mongosh "mongodb://localhost:27017/mongo_labs?replicaSet=rs0"

4. View These Docs Locally

pip install -r requirements.txt
mkdocs serve
# open http://localhost:8000

📚 Learning Path

Step Resource Description
1 NoSQL & MongoDB Document model, CAP theorem, when to use MongoDB
2 Core Concepts BSON, replica sets, ObjectId, collections
3 Data Modeling Embedding vs referencing, schema patterns
4 Indexes & Aggregation Index types, pipeline stages
5 Transactions & Consistency ACID, read/write concerns
6 TTL & Change Streams Data expiry, real-time events
7 Advanced Aggregation $lookup, $facet, $graphLookup
8 Advanced Topics Sharding, security, monitoring

🔬 Lab Exercises

Hands-on MongoDB shell (mongosh) scripts in the labs/ directory.
See Labs Overview for the full list with descriptions.