MongoDB CRUD Operations: Replace and Delete Documents
Learn how to replace and delete documents in the mongo shell.
MongoDB CRUD Operations: Replace and Delete Documents
Unit Overview
In this unit, you’ll learn how to update, replace, and delete documents in MongoDB. These commands will help you manipulate data in your database and will prepare you to build MongoDB into your own apps. We will replace entire documents, update individual fields in a document, insert new documents, and remove documents from a database. By the end of this unit, you'll be able to execute most of the common database operations.
Prerequisites
- Getting Started with MongoDB Atlas
- MongoDB and the Document Model
- MongoDB CRUD Operations: Insert and Find
Lessons in This Unit
- Lesson 01: Replacing a Document in MongoDB
- Lesson 02: Updating MongoDB Documents by Using
updateOne() - Lesson 03: Updating MongoDB Documents by Using
findAndModify() - Lesson 04: Updating MongoDB Documents by Using
updateMany() - Lesson 05: Deleting Documents in MongoDB
-
01.
-
02.Lesson 2: Updating MongoDB Documents by Using updateOne()
- Learn
- Practice
-
03.Lesson 3: Updating MongoDB Documents by Using findAndModify()
- Learn
- Practice
-
04.Lesson 4: Updating MongoDB Documents by Using updateMany()
- Learn
- Practice
-
05.Lesson 5: Deleting Documents in MongoDB
- Learn
- Practice
-
06.Conclusion
- Learn
John McCambridge I 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.
Camden Kirkland I Technical Instructor
Cam is a Technical Instructor at MongoDB where he delivers courses for a wide variety of foundational and advanced topics on the database. Prior to MongoDB, he was a Curriculum Architect designing technical programs for web development, data analytics, and financial technologies for universities all over the country. In a past life he was a Chemist making sure your transformers didn't catch fire.
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.
