MongoDB Tutorial
Course Contents
MongoDB Fundamentals
- MongoDB Introduction
- Installing MongoDB
- SQL vs MongoDB: A Mental Model Shift
- Databases, Collections, and Documents
- The mongosh Shell
- MongoDB Atlas (Cloud) Get Started
Documents and BSON
- The Document Data Model
- BSON vs JSON
- Data Types in MongoDB
- The _id Field and ObjectId
- Embedded Documents and Arrays
Inserting Data
Querying Data
- find and findOne
- Query Operators ($eq, $gt, $lt, $in)
- Logical Operators ($and, $or, $not)
- Querying Embedded Documents and Arrays
- Projection: Selecting Fields
- sort, limit, and skip
- Counting Documents
Updating and Deleting Data
- updateOne and updateMany
- Update Operators ($set, $inc, $unset)
- Array Update Operators ($push, $pull, $addToSet)
- upsert
- deleteOne and deleteMany
- findOneAndUpdate and findOneAndDelete
Indexes
- Why Indexes Matter
- Creating Indexes
- Compound Indexes
- Unique Indexes
- Text Indexes and Text Search
- Using explain() to Analyze Queries
The Aggregation Framework
- Aggregation Pipeline Introduction
- $match and $project
- $group and Accumulators
- $sort, $limit, and $skip in Pipelines
- $lookup: Joining Collections
- $unwind
- Building a Multi-Stage Aggregation Pipeline
Schema Design
- Schema Design Principles in MongoDB
- Embedding vs Referencing
- One-to-Many Relationships
- Many-to-Many Relationships
- Designing for Your Query Patterns
Data Validation
Transactions and Consistency
- ACID Transactions in MongoDB
- Multi-Document Transactions
- Read and Write Concerns
- Atomicity at the Document Level
MongoDB with Node.js
- Connecting to MongoDB from Node.js
- The MongoDB Node.js Driver: CRUD
- Using Mongoose: Schemas and Models
- Mongoose Validation and Middleware
- Connection Pooling in Node.js
Replication and High Availability
Sharding and Scaling
Security and Administration
- MongoDB Authentication
- Role-Based Access Control
- Connection Strings and Security
- Backup and Restore (mongodump/mongorestore)
- Monitoring MongoDB Performance
