MongoDB · Beginner READ & PRACTISE

MongoDB Fundamentals

Learn MongoDB, the document database used by startups and large companies alike. Store flexible JSON-like documents, query and update them, model data the NoSQL way, build reports with the aggregation pipeline, and connect MongoDB to Node.js and Python apps.

4

units

20

lessons

83

practice questions

~300

minutes

Start learning today

Create a free account, then unlock this and every other Pro course with Learnix Pro for KES 999/month.

Create free account I already have an account

Outcomes

What you'll be able to do

Understand documents, collections and when to choose NoSQL

Create a free Atlas cluster and use mongosh and Compass

Insert, query, update and delete documents

Model data with embedding and references

Build reports with the aggregation pipeline

Speed up queries with indexes

Use MongoDB from Node.js (Mongoose) and Python (PyMongo)

How it works

Read it, see it, practise it

Each lesson explains one topic clearly, shows worked examples, checks your understanding with quick questions and ends with a practical task you complete yourself.

Clear explanations

Step-by-step lessons in plain language

22 in this course

Worked examples

Real code and examples you can copy and run

20 in this course

Quick checks

Test your understanding as you go

60 in this course

Fill the blank

Recall the key commands and syntax

20 in this course

Hands-on workspace

A practical task at the end of every lesson

20 in this course

Syllabus

Everything you'll encounter

1

What Is MongoDB? Documents vs Tables

How document databases differ from relational ones, what MongoDB is great at, and when SQL is the better choice.

2

Setting Up: Atlas, mongosh & Compass

Create a free MongoDB Atlas cluster, connect securely, and use mongosh and Compass to explore data.

3

Documents, BSON Types & ObjectId

Understand document structure, BSON data types (dates, decimals, ObjectId) and the 16 MB limit.

4

Inserting & Finding Documents

insertOne, insertMany, find, findOne, projections, sorting, limiting and counting.

5

Query Operators: $gt, $in, $or, $regex & More

Filter with comparison, logical, element and pattern operators, and query nested fields with dot notation.

1

Updating & Deleting Documents

updateOne, updateMany, $set, $inc, $unset, upserts, replaceOne and safe deletes.

2

Working with Arrays & Embedded Documents

Push, pull and update items inside arrays, and query embedded documents with $elemMatch.

3

Data Modelling: Embed or Reference?

The most important MongoDB skill: design documents around how your app reads data, using embedding, references and common patterns.

4

Schema Validation

Use JSON Schema validators so MongoDB rejects bad documents: required fields, types, ranges and allowed values.

5

Indexes & explain()

Make queries fast with single-field, compound, unique, TTL and multikey indexes, and check plans with explain().

1

Aggregation Pipeline Basics

Build reports with stages: $match, $group, $sort, $project and $limit.

2

Joining & Flattening: $lookup and $unwind

Combine collections with $lookup (a left join) and work with array items using $unwind.

3

Reporting: Dates, Buckets & Facets

Monthly sales with $dateTrunc, price bands with $bucket, and multi-report dashboards with $facet.

4

Text Search & Location Queries

Search product names and descriptions with text indexes, and find the nearest shops with geospatial queries.

5

Transactions & Atomic Operations

Single-document operations are atomic; for multi-document changes use transactions in a session.

1

MongoDB from Node.js

Connect with the official Node.js driver, run CRUD and aggregations, and build a small Express API.

2

Mongoose: Schemas & Models for Node.js

Add structure to MongoDB apps with Mongoose schemas, validation, defaults, middleware and populate().

3

MongoDB from Python with PyMongo

Use MongoDB in Python scripts and data work: CRUD, aggregations and exporting to pandas.

4

Security, Users & Backups

Authentication, least-privilege roles, network rules, encryption and backups for MongoDB in production.

5

Project: Event Ticketing API

Build an event ticketing backend with MongoDB: events, tickets, M-Pesa payment states, seat limits and sales reports.

Finish the course, earn a verifiable certificate

Complete every lesson, then pass the 20-question final exam (70% to pass, unlimited retakes), to receive a Learnix certificate with a unique number anyone can verify online.

Helping with:

🍪 We use essential cookies to keep you signed in, protect your account and remember your settings. We don't use advertising or tracking cookies. Read our Privacy Policy.