Back

Documents and Collections

MongoDB stores data as documents (JSON-like objects) inside collections (groups of documents). There's no fixed schema, so documents in one collection can have different fields, and you can nest related data.

// A document in the "users" collection
{
  "_id": ObjectId("65f1..."),
  "name": "Daniel",
  "email": "daniel@example.com",
  "skills": ["React", "Node"],
  "address": { "city": "Dallas", "state": "TX" }
}

SQL           MongoDB
table    ->   collection
row      ->   document
column   ->   field

Roadmap