Copilot Context: MongoDB Learning Labs (consolidated)

Copilot Context: MongoDB Learning Labs (consolidated)

Project Overview

Key Project Structure

├── docs/
│   ├── index.md                              # Home page with quick start guide
│   ├── labs-overview.md                      # Lab exercises overview
│   ├── interview-prep.md                     # Interview Q&A and self-assessment
│   ├── theory/                               # 8 comprehensive theory modules
│   │   ├── 01-nosql-and-mongodb.md          # NoSQL concepts, CAP theorem, why MongoDB
│   │   ├── 02-core-concepts.md              # BSON, ObjectId, replica sets, oplog
│   │   ├── 03-data-modeling.md              # Embedding vs referencing, schema patterns
│   │   ├── 04-indexes-and-aggregation.md    # Index types, aggregation pipeline stages
│   │   ├── 05-transactions-and-consistency.md # ACID transactions, read/write concerns
│   │   ├── 06-ttl-and-change-streams.md     # TTL indexes, change streams, capped collections
│   │   ├── 07-aggregation-advanced.md       # $lookup, $facet, $bucket, $graphLookup, $setWindowFields
│   │   ├── 08-advanced.md                   # Sharding, security, monitoring, performance
│   ├── js/
│   │   └── mermaid-init.js                  # Mermaid diagram initializer
├── labs/                                    # 11 progressive MongoDB shell lab exercises
│   ├── 01_database_basics.js
│   ├── 02_document_modeling.js
│   ├── 03_indexes.js
│   ├── 04_aggregation_pipeline.js
│   ├── 05_transactions.js
│   ├── 06_ttl_and_capped.js
│   ├── 07_advanced_aggregation.js
│   ├── 08_schema_patterns.js
│   ├── 09_replica_set.js
│   ├── 10_security_basics.js
│   └── 11_monitoring_and_performance.js
├── docker/
│   ├── docker-compose.yml                   # 3-node MongoDB replica set + mongo-express
│   ├── init.js                              # Database initialization script
│   └── start.sh                             # Quick start script
├── mkdocs.yml                               # MkDocs configuration
├── requirements.txt                         # Python dependencies (MkDocs, plugins)
└── README.md                                # Project overview

Theory Materials - What Each Module Covers

Each theory module includes:

Key Learning Areas & Conventions

1. Document Model & Schema (Theory 01-03, Labs 01-02, 08)

2. Indexes (Theory 04, Labs 03)

3. Aggregation Pipeline (Theory 04, Labs 04, 07)

4. Transactions & Consistency (Theory 05, Labs 05)

5. Data Lifecycle (Theory 06, Labs 06)

6. Data Modeling Patterns (Theory 03, Labs 08)

7. Replica Sets & Consistency (Theory 02, Labs 09)

8. Sharding, Security & Monitoring (Theory 08, Labs 10-11)

Important Files & Their Purposes

Coding Standards & Practices

Common Development Tasks

Running Labs

# Start 3-node replica set
cd docker && docker compose up -d

# Run individual lab exercise
docker exec -it mongo1 mongosh --file /labs/03_indexes.js

# Connect to interactive shell
docker exec -it mongo1 mongosh

# Or from host (requires mongosh installed locally)
mongosh "mongodb://localhost:27017/mongo_labs?replicaSet=rs0"

Common Queries

// Switch database
db = db.getSiblingDB("mongo_labs");

// View collection schema
db.getCollectionInfos();

// Check indexes
db.collection_name.getIndexes();

// Replica set status
rs.status();
rs.conf();

Debugging Performance Issues

Interview Prep Notes

Update History