Skip to content

What is a Document?

Estimated time to read: 1 minute

Documents

A document is a way to organize and store data as a set of field-value pairs.

The field is a unique identifier for a datapoint and the value is data related to a given identifier.

In the example below, there is a field called "name" with the value of "Tavis".

{
    "name"      :   "Tavis",
    "title"     :   "Clueless Developer",
    "age"       :   "29  
}

Collections

A collection is an organized store of documents in MongoDB, usually with common fields between documents.

{
    "name"      :   "Tavis",
    "title"     :   "Clueless Developer",
    "age"       :   29  
}

{
    "name"      :   "Toby",
    "title"     :   "Developer",
    "age"       :   24  
}