Document Format Document Structure Field Names MongoDB Documentation, Release 3.0.4 169 4.4. Data Model Reference MongoDB stores documents on disk in the BSON serialization format. BSON is a binary representation of JSON documents, though it contains more data types than JSON. For the BSON spec, see bsonspec.org$^{13}$. See also BSON Types (page 178). The mongo JavaScript shell and the MongoDB language drivers translate between BSON and the language- specific document representation. MongoDB documents are composed of field-and-value pairs and have the following structure: The value of a field can be any of the BSON data types (page 178), including other documents, arrays, and arrays of documents. The following document contains values of varying types: The above fields have the following data types: Field names are strings. Documents (page 168) have the following restrictions on field names: $^{13}$http://bsonspec.org/ { field1: value1, field2: value2, field3: value3, ... fieldN: valueN } var mydoc = { _id: ObjectId("5099803df3f4948bd2f98391"), name: { first: "Alan", last: "Turing" }, birth: new Date('Jun 23, 1912'), death: new Date('Jun 07, 1954'), contribs: [ "Turing machine", "Turing test", "Turingery" ], views : NumberLong(1250000) } • name holds an embedded document that contains the fields first and last . • _id holds an ObjectId . • birth and death hold values of the Date type. • contribs holds an array of strings . • views holds a value of the NumberLong type. • The field name _id is reserved for use as a primary key; its value must be unique in the collection, is immutable, and may be of any type other than an array. • The field names cannot start with the dollar sign ( $ ) character. • The field names cannot contain the dot ( . ) character. • The field names cannot contain the null character.