MongoDB

Stage 1 · Lesson 1 of 8

Documents, fields and the document model

Documents and your setup

MongoDB stores data as documents: records made of and value pairs that look like JSON objects. A value can be a string, a number or a date, but also a or an (a list), so one customer document can hold its addresses inline.

Documents live in , and collections live in databases. Unlike a relational table, a collection does not force every document to have the same fields. That flexibility lets you shape each document around how the application reads it, often fetching everything a page needs in one query. It is also why data modelling matters so much later: nothing stops you storing a mess.

Common traphearing "" and deciding you need no design at all, when the schema has simply moved from the database into your application code.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with

  • CourseFree
    MongoDB University

    MongoDB

    Free: start with the introduction to MongoDB and Atlas setup lessons, which use the same sample data

Practise

  • Paste a few documents and a query and run it in the browser, no install needed

Keep handy

  • The mongosh docs: connecting, running scripts and the shell helpers such as show and use

  • The Compass docs for the Schema, Explain Plan and Aggregations tabs you will use later

Also worth your time

Mark this stage as not done?