Learn MongoDB by running it · CRUD & aggregation pipelines

MongoDB you can run, break, and watch

Every page has a live Mongo shell powered by a real query engine running in your browser. Type db.collection.find(…) or an aggregate([…]) pipeline, drag a slider, and watch documents flow through each stage. No install, no Atlas, no internet — just you and a little cafe database called Byte Bites.

Try it right now — drag the slider This is a real query. Move the price cap and watch matching documents appear and vanish.
Live shell · the menu under a price cap
edit the query freely · Ctrl+Enter also runs

🍃Meet the database: Byte Bites cafe

Three collections of documents — JSON-like objects that can hold arrays and nested data (that's the whole point of MongoDB). Every example uses them:

🥐 products 8 docs

{ _id, name, category, price, tags: [...] } — note the array field tags.

👤 customers 8 docs

{ _id, name, city, vip, joined, visits } — one customer (Hana) has never ordered, on purpose.

🧾 orders 10 docs

{ _id, customer_id, date, status, items: [ {product, qty, price} ] } — an array of sub-documents, perfect for $unwind.

Coming from SQL? A collection is a table, a document is a row — except a document can nest arrays and objects inside it, so you often store related data together instead of splitting it across tables. You'll feel the difference the moment you hit $unwind and $lookup.

🗺️The journey

1 · Documents & Collections start

What a document database is, JSON/BSON, dot notation, and a tour of the data.

2 · find() & projection

Query by field, reach into nested fields and arrays, and choose which fields come back.

3 · Query operators

$gt $lt $in $regex $exists $and $or — with sliders so you feel each one.

4 · sort, limit, count

Order results, take the top N, count and get distinct values.

5 · Create · Update · Delete

insertOne, updateOne with $set/$inc, deleteOne — with a Reset net.

6 · The aggregation pipeline ★ visual

The big idea: documents flow through stages. Watch $match and $project live.

7 · $group & accumulators

$sum $avg $min $max $push — turn many documents into summaries.

8 · $unwind & $lookup

Explode arrays into rows and join collections — the two power stages.

9 · Pipeline Lab ★ build one

Assemble a multi-stage pipeline with sliders and watch every stage transform the docs.

10 · Cheat Sheet & Challenges graded

One-page reference plus puzzles the engine checks for you.

📈Your progress

Saved in your browser — close the tab and come back where you left off.

🔓 You're reading a free chapter of MongoDB — the first two are open.
Unlock the rest of this course with a one-time payment.
Unlock this course →
🔓 See course prices