Suggest an editImprove this articleRefine the answer for “What is a document in MongoDB?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A document in MongoDB is the basic unit of data storage, analogous to a row in SQL, but as a BSON object resembling JSON: a set of key-value fields, with support for nesting and a flexible structure. **Key point:** every document has an `_id` field that serves as its primary key (created automatically if not set explicitly), and different documents in the same collection can have different sets of fields.Shown above the full answer for quick recall.Answer (EN)ImageA document in MongoDB is the basic unit of data storage, analogous to a row in SQL, but as a **BSON object** resembling JSON. ### Key characteristics 1. **A "key-value" structure** A document is a set of fields: ```json { "name": "Alex", "age": 25, "skills": ["JS", "MongoDB"] } ``` 2. **Flexibility** Different documents in the same collection can have different sets of fields. They don't have to share the same "schema". 3. **Nesting** Documents can hold nested objects and arrays, letting you store complex structures right inside a single record. 4. **A unique** `_id` Every document has an `_id` field used as its primary key (created automatically if not set). **The essence of it:** a document is a self-contained data record, stored in BSON format, supporting nesting and a flexible structure.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.