MongoDB Collections
Explore how to work with MongoDB collections within Meteor.js by learning about BSON document structure, creating collections, and interacting with data. This lesson helps you understand managing collections both on the client and server sides for reactive full-stack applications.
We'll cover the following...
We'll cover the following...
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" },
...