Lesson
Inserting Documents into MongoDB Collections (insertOne, insertMany)
Insert documents into MongoDB collections using the Mongo shell mongosh and MongoDB Compass, using the insertOne and insertMany methods
- Access
- Included
- Transcript
- Needs source
In this lesson, we learn that inserting documents into a MongoDB collection can be done using the insertOne and insertMany methods.
We demonstrate how to create new employee objects in JSON format and add them to a collection.
We also show how to view the inserted documents and their automatically generated IDs.
Furthermore, we discuss how to delete documents from a collection using filtering criteria.