MongoDB From Scratch

Design, Query, and Manage NoSQL Databases from Your First Document to Production

Lessons 31
Duration ~ 8 hours
Study Hours 16 - 32

This course is available via:

Plan Courses Price Action
Node & Mongo ⓘ 2
$50 / year
EGP 2,500 / year
Subscribe

Subscribe to it individually:

This course only
$30 / year
EGP 1,500 / year
Subscribe

What Will You Learn

Document Modeling

Design schemas driven by access patterns: embed vs reference, one-to-few and one-to-many relationships, $lookup, and document-model diagrams.

CRUD & Application Integration

Insert, query, update, and delete with every core operator and bulkWrite, then do the same from Node.js with the native driver and Mongoose.

Indexes & Performance Tuning

Read explain() output, apply the ESR rule, build compound, multikey, text, TTL, and geospatial indexes, and fix real anti-patterns with the profiler.

Aggregation Framework

Build real analytics pipelines with $match, $group, $unwind, $lookup, $facet, expressions, and accumulators, ordered for speed.

Internals, Security & Operations

Understand WiredTiger, replication, sharding, and transactions; secure data with roles, TLS, and field-level encryption; back up and restore.

Prerequisites

In order to start this course you must have these skills:

Basic Programming Knowledge

Understanding of how a simple web service or script executes. No prior database experience is needed.

Command Line Basics

Comfort running simple commands in a terminal, as you will work in mongosh and use tools like mongodump.

Recommended Courses:

Instructor

Instructor Avatar

Mohamed Adel

Senior Full Stack Engineer

6

Mohamed Adel is a Senior Full Stack Engineer and Software Instructor with hands-on experience in building web applications and software systems. His expertise spans backend development, modern JavaScript technologies, and database integration, with a strong focus on practical software engineering. Alongside his professional development work, Mohamed has experience delivering technical training and making complex concepts accessible to learners.

Course Content

Chapter 1: Local Environment Setup
1 lessons 0.2 hour
1 - Install MongoDB, mongosh, and Compass
13 min
Chapter 2: First Documents & BSON Types
3 lessons 0.8 hour
2 - Insert and read your first documents sample
17 min
3 - BSON types in practice
24 min
4 - ObjectId anatomy
9 min
Chapter 3: Mental Model - Why MongoDB?
1 lessons 0.2 hour
5 - MongoDB vs SQL: when to use which
12 min
Chapter 4: Document Modeling
3 lessons 1 hour
6 - Model a blog: embed vs reference, live sample
30 min
7 - Referencing: manual refs and $lookup
18 min
8 - Document ERD notation
10 min
Chapter 5: CRUD Operations
4 lessons 1 hour
9 - insertOne and insertMany
9 min
10 - Querying: find and all operators
19 min
11 - Updating documents
22 min
12 - Delete and bulkWrite
8 min
Chapter 6: Drivers & Application Integration
2 lessons 0.7 hour
13 - Connect Node.js to your database
28 min
14 - ODMs: Mongoose
16 min
Chapter 7: Indexes
3 lessons 0.7 hour
15 - Run a slow query, read explain(), add an index
12 min
16 - Compound, multikey, text, TTL, and geospatial indexes
19 min
17 - Managing indexes
12 min
Chapter 8: Internals - Under the Hood
3 lessons 0.5 hour
18 - WiredTiger: storage, MVCC, compression, journaling
11 min
19 - Replication: replica sets, oplog, write concerns
11 min
20 - Sharding: shard keys, chunks, balancing, mongos
8 min
Chapter 9: Aggregation Framework
3 lessons 0.8 hour
21 - Build a real analytics query from scratch
15 min
22 - unwind, lookup, addFields, facet, out
15 min
23 - Expressions, accumulators, and stage ordering
19 min
Chapter 10: Transactions
2 lessons 0.4 hour
24 - When single-document atomicity is enough
0 min
25 - Write a multi-document transaction
24 min
Chapter 11: Performance & Optimization
3 lessons 0.9 hour
26 - Reproduce anti-patterns and fix them
21 min
27 - Read explain()
24 min
28 - Profiler, currentOp, serverStatus
11 min
Chapter 12: Security & Administration
3 lessons 0.7 hour
29 - Create users, assign roles, enforce least privilege
10 min
30 - TLS, IP allowlists, and field-level encryption
24 min
31 - Backup, restore, and upgrade basics
10 min