MongoDB CRUD Operations in Node.js
Learn how to perform basic CRUD operations with the MongoDB Node.js driver.
MongoDB CRUD Operations in Node.js
Unit Overview
In this unit, you will learn how to perform basic CRUD operations with Node.js. First, you will learn how BSON documents are expressed in Node.js. Then, you'll learn how to insert, query and retrieve, update, and delete documents in a Node.js application. Finally, you'll learn how to create a multi-document transaction.
Prerequisites
Lessons in This Unit
- Lesson 01: Working with MongoDB Documents in Node.js
- Lesson 02: Inserting a Document in Node.js Applications
- Lesson 03: Querying a MongoDB Collection in Node.js Applications
- Lesson 04: Updating Documents in Node.js Applications
- Lesson 05: Deleting Documents in Node.js Applications
- Lesson 06: Creating MongoDB Transactions in Node.js Applications
-
01.
-
02.Lesson 2: Inserting a Document in Node.js Applications
- Learn
- Practice
-
03.Lesson 3: Querying a MongoDB Collection in Node.js Applications
- Learn
- Practice
-
04.Lesson 4: Updating Documents in Node.js Applications
- Learn
- Practice
-
05.Lesson 5: Deleting Documents in Node.js Applications
- Learn
- Practice
-
06.Lesson 6: Creating MongoDB Transactions in Node.js Applications
- Learn
- Practice
-
07.Conclusion
- Learn
John McCambridge I University Curriculum Engineer
John is a Curriculum Engineer on the University team at MongoDB. Before his work as a Curriculum Engineer, he was an instructor and teaching assistant for coding boot camps at UT (Austin), and UCLA. Additionally, he worked as a QA engineer for a startup called Coder and spent five years at Apple Inc. John is a passionate software engineer and eductor who enjoys taking complex topics and making them digestible for the community.
Emily Pope | Senior Curriculum Designer
Emily is a Senior Curriculum Designer at MongoDB. Prior to MongoDB, Emily worked closely with professors at MIT and Columbia to design bootcamps in full stack development and data science at Emeritus. She also worked as an instructional designer on database and computer science learning experiences at Cengage. Emily loves learning about the everchanging tech space and is passionate about making these skills accessible to a global audience.
Hi there and welcome! In this unit, you will learn how to perform basic CRUD operations for your Node.js application. CRUD stands for Create, Read, Update, and Delete.
I’m John. I'm a Curriculum Engineer here at MongoDB and will be working with you through this unit.
Using CRUD, you’ll be able to interact with your data in your Node.js application. A database is only useful if you can leverage the data.
In this unit, we’ll also cover how to create a multi-document transaction in Node.js so that you can ensure your operations are ACID compliant.
The lessons in this unit consist of video lectures followed by quiz questions or labs so that you can practice what you learned.
First, you will learn how BSON documents are expressed in Node.js by using documents.
Then, you’ll learn how to insert documents into our application.
You’ll also learn how to query and retrieve documents from a collection.
Next, you will learn how to update single and multiple documents.
Then, you’ll learn how to delete single or multiple documents.
Finally, you’ll learn how to create a multi-document transaction by using the callback API.
Before you begin this unit, you should have a basic understanding of: Node.js, The MongoDB database and document model, and Atlas.
You will also need to set up an Atlas account with a free tier cluster.
By the end of this unit, you will be able to describe how BSON documents are expressed in Node.js, perform basic CRUD operations in Node.js, and create a multi-document transaction.
Let’s get started