Document Modelling Checkpoint

Model GreenMart's Marketplace Catalog

Playground Checkpoint

Design and build a real schema — no auto-grading, just a real attempt.

20–25 min

The Challenge

Six chapters of reasoning and real syntax, all converging on one real challenge: build GreenMart's actual marketplace catalog, from nothing, the way this whole Act argued it should be built.

Open the Playground and write real commands: insert three listings — an electronics item, a clothing item, and a produce item — each shaped for exactly what it needs, with the seller's name and rating embedded the way chapter 2 decided. Then insert one review as its own document, referencing its listing by id. Finish with two real queries: one finding a seller's listings sorted by price, and one aggregation computing the average price per category.

What Your Catalog Needs

  • Three listings inserted into a listings collection — electronics, clothing, and produce — each carrying only the fields that product actually needs (no shared column list, no empty fields).
  • Each listing embeds its seller's name and rating directly (the Extended Reference Pattern from this Act's closing chapter) — not a separate lookup.
  • At least one review inserted into its own reviews collection, referencing its listing through a listingId field — not embedded inside the listing itself.
  • A query returning one seller's listings, sorted by price.
  • An aggregation pipeline computing the average price per category across all three listings.
Stuck? A Few Hints
  • Insert the listings first — the review's listingId needs a real listing to point at.
  • Chapter 1 already showed the exact shape a listing document should take — reuse it, don't redesign it from scratch.
  • The aggregation only needs three stages: $match (if you want to narrow it down first), $group by category with $avg, and optionally $sort.

Ready to Build It?

Opens the Playground, right in your browser — nothing to install.

Open Playground

Every insertOne() should report a real _id and show your inserted document. The find() and aggregate() calls should return real results built from what you just inserted — if a query comes back empty, double-check the field names match exactly what you inserted (MongoDB never auto-corrects a typo'd field name).

Before You Move On

This exact command surface — insertOne, embedded fields, a separate referenced collection, find() with a filter and a sort, and a $group aggregation — is everything this Act actually taught, put to work in one script. The next Act picks up a genuinely different problem: not how data is shaped, but how fast GreenMart can read and write it under real pressure.

Next