From the course: MongoDB Node.js Developer Associate Cert Prep

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Working with MongoDB documents in Node.js

Working with MongoDB documents in Node.js

- Hello. In this video you'll learn how BSON documents are expressed in Node.js. You'll also learn how to define a document by using Node.js. Binary JSON, or BSON, is the data format that MongoDB uses to organize and store data. BSON is optimized for storage retrieval and transmission across the wire. BSON is more secure than plain text JSON, which is vulnerable to JSON injection attacks. BSON also supports more data types than JSON. The MongoDB Node.JS driver allows us to represent BSON documents as JavaScript objects. Documents are the foundational organizing principle for storing data in MongoDB because they provide flexible and concise data representation. Let's examine a typical BSON document to understand how documents are represented in Node.js. We'll work with a BSON document from the accounts collection in the bank database. Let's take a look. The _id field is a unique identifier for a document in a…

Contents