MongoDB Collections

Learn about MongoDB collections and how to create them in MeteorJS.

What’s a collection?

A collection in MongoDB is a group of MongoDB documents. MongoDB stores data as BSON documents. BSON is a binary representation of JSON.

Documents are composed of field-and-value pairs with the following structure: The { field1: value1, field2: value2, field3: value3, ... fieldN: valueN } structure says that a field’s value can contain any of the BSON data types, which includes other documents, arrays, and arrays of documents.

 const personDoc = {
    _id: ObjectId("5099803df3f4948bd75858581"),
    name: { first: "John", last: "Mansa" },
    dob:
...