Learn MongoDB.
Build with confidence.

Start with documents and collections, progress through production-minded queries and data modeling, then master the official MongoDB driver and operational tools inside MongoG.

Examples verified with the official mongodb 7.5.0 driver

From first document to confident operations.

Every lesson uses the isolated mongog_tutorial database, explains the expected result, and ends with practice work and official references.

  1. 01
    Build the foundation

    Learn BSON, document modeling, CRUD filters, and safe write results.

  2. 02
    Shape reliable data

    Add validation, indexes, aggregation, bulk workflows, and relationship queries.

  3. 03
    Work inside MongoG

    Use real driver objects, automatic await, paged cursors, and document workspaces.

  4. 04
    Operate deliberately

    Read explain plans, observe streams, inspect GridFS, and verify every mutation.

Understand the database.

A practical path from your first document to validated models, efficient relationships, and multi-document transactions.

01

Getting Started with MongoDB

Learn MongoDB's document model, create a tutorial database, and run your first query with the official Node.js driver inside MongoG.

02

Documents, Collections, and BSON

Understand MongoDB documents, collections, ObjectId values, dates, numeric types, arrays, nested objects, and the BSON format behind them.

03

Data Modeling in MongoDB

Design MongoDB documents around application access patterns and choose between embedding related data and referencing separate collections.

04

Insert Documents with MongoDB

Insert one or many MongoDB documents, inspect acknowledged write results, choose identifiers, and keep repeatable tutorial scripts safe.

05

MongoDB Query Examples for Filters and Projection

Use practical MongoDB query examples for equality, comparison, arrays, nested fields, projection, sorting, limits, null values, and stable pagination.

06

MongoDB updateMany and Delete Query Examples

Use MongoDB updateOne, updateMany, replace, upsert, find-and-modify, and delete examples with precise filters, result checks, and safer write practices.

07

MongoDB Aggregation Pipeline Examples

Build MongoDB aggregation examples that filter, reshape, group, sort, unwind, facet, and validate data, then inspect the real cursor in MongoG.

08

MongoDB Index Examples and Explain Plans

Create MongoDB indexes for real query examples, choose compound key order, read execution statistics, and verify access paths with explain plans.

09

MongoDB Transactions with the Node.js Driver

Use sessions and transactions for atomic multi-document changes, handle failures, and understand when MongoDB's single-document atomicity is enough.

10

Validate MongoDB Documents with JSON Schema

Add server-side MongoDB validation rules, test valid and invalid writes, and evolve an existing collection without losing schema flexibility.

11

Run MongoDB Bulk Write Operations

Combine inserts, updates, replacements, and deletes with collection bulkWrite, inspect result counts, and handle ordered or unordered failures.

12

MongoDB $lookup Examples for Relationships

Use practical MongoDB $lookup examples to join related collections, flatten arrays, filter joined data, inspect plans, and decide when embedding is better.

13

Find MongoDB Documents That Contain a String

Query MongoDB string fields with exact values, regular expressions, case-insensitive matching, escaping, indexes, and safer alternatives for text search.

14

Query a Date Range in MongoDB

Build correct MongoDB date-range queries with inclusive and exclusive boundaries, UTC values, ObjectId timestamps, indexes, aggregation, and verification.

15

MongoDB Array Query Examples

Query arrays in MongoDB with exact matches, any-element conditions, $all, $elemMatch, array indexes, projection, and aggregation without ambiguous results.

16

MongoDB Group By Examples with $group

Group MongoDB documents by fields, dates, and compound keys; calculate totals, averages, counts, and top values with correct aggregation pipeline ordering.

Make the workspace yours.

Learn what MongoG adds around the real driver, from typed scripts and paged results to BSON-safe editing and administration.

Run every example in MongoG.

Connect to a local deployment or MongoDB Atlas and work through the tutorials in a typed, focused query editor.

Download MongoG