Camp 1 · Schritt 2 von 12
JSON: the language of documents
Objects, arrays, and values — learn to read and write the format the entire modern web speaks.
Document databases store JSON (JavaScript Object Notation) — which happens to also be the format APIs speak, config files use, and this site's search index is stored in. Learning it pays rent everywhere.
An object
{
"name": "Ada",
"trail": "python",
"streak": 7,
"premium": false
}- Curly braces
{ }wrap an object - Each entry is a
"key": valuepair, comma-separated - Keys are always double-quoted strings
The six value types
| Type | Example |
|---|---|
| string | "Ada" (double quotes only!) |
| number | 7, 3.14, -2 |
| boolean | true, false |
| null | null — deliberately empty |
| array | ["boots", "map"] |
| object | { "lat": 46.5, "lon": 11.3 } |
Arrays and objects nest — that's the superpower:
{
"name": "Ada",
"gear": ["boots", "compass"],
"camp": { "name": "Base", "altitude": 1200 },
"buddy": null
}One document holds a whole shape — a profile, an order with its items, a lesson with its quizzes — no assembly from separate tables required.
The strict bits
JSON is fussier than JavaScript: double quotes only, no trailing commas, no comments. Every parser on Earth agrees on these rules — which is exactly why everything can talk to everything.
Which of these is valid JSON?
How would you represent a hiker's three badges in JSON?
What's next
Documents vs. tables, head to head — the same data modeled both ways.