In this lab, students are asked to perform a set of CRUD (Create, Read, Update, and Delete) operations using the mongo shell. After completing this lab, students will have hands-on experience in performing each of the basic data manipulation operations.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a New Collection and Load Data into It
Load the data from
users.csv
into a new collection using themongoimport
tool.- Read the Documents
Read the documents from the collection using the
db.collection.find()
method.- Update a Document
Update one document using the
db.collection.updateOne()
method to set department =Engineering
in the document with name =Betty
.- Delete a Document
Delete one document with name =
David
using thedb.collection.deleteOne()
method.