Reference · Glossary
MongoDB glossary
The shared vocabulary of this course. Once a term is defined here, every lesson uses it this way — with the relational contrast attached where it helps.
Context: MongoDB current (7.0/8.0+)All lessons
- Document
- The basic unit of data: an ordered set of field/value pairs, stored as BSON. A tree, not a flat row — values can be nested documents and arrays. Introduced in 0001.
Relational analog: a row (but schema-free and nestable).
- BSON
- Binary JSON — MongoDB's on-disk and on-the-wire encoding of documents. A binary superset of JSON with extra types (dates, 64-bit ints, binary, ObjectId, Decimal128).
- Collection
- A grouping of documents. The rough equivalent of a table, but with no enforced schema — documents in one collection can have different shapes.
_id
- The mandatory primary-key field, unique within a collection and immutable. Auto-populated with an ObjectId if you don't supply one. MongoDB always keeps a unique index on it.
Relational analog: the primary key.
- ObjectId
- A 12-byte identifier the driver generates for
_id when you omit it. Roughly time-ordered, so it sorts by creation time.
- Embedding
- Storing related data inside a document (nested doc or array), so it's read in one lookup. The default modeling move, driven by "data accessed together is stored together." Introduced in 0001.
Relational analog: the opposite of normalizing into separate tables.
- Referencing
- Linking documents by storing another document's
_id and looking it up separately. Used when data is large, unbounded, or accessed independently.
Relational analog: a foreign key (but joins are manual / via $lookup).
- Single-document atomicity
- A write to one document is all-or-nothing, even across many fields and nested arrays — no transaction required. Atomicity is a property of the document boundary. Introduced in 0001.
- Distributed (multi-document) transaction
- The mechanism for atomic reads/writes spanning more than one document or collection. Costs more than a single-document write; good schema design (embedding) often removes the need.
Relational analog: an ordinary
BEGIN … COMMIT transaction.