Skip to content
Theory · MongoDB: Documents, Queries, Embed or Reference · lesson 1 of 12

Documents and collections

The latte card _id: 4 from the recipe box holds everything at once, the options list and the clipped nutrition slip; no pages to join

In the ledger from the MVCC chapter, every menu item is a row with the same columns. To learn the latte's volumes and add-ons, the bookkeeper opens other pages and matches numbers: in SQL that is a join. The barista has something else at hand: a box of recipe cards. The latte's card holds everything at once — name, price, volumes, the list of add-ons, and a slip with its calories pinned to it.

In this lesson

  • The document
  • The collection and _id
  • What a document gives and costs
  • MongoDB and the emulator
  • Common mistake
  • Key points