MongoDB Quiz
Check what you have learned in the MongoDB tutorial. All questions use the students collection from the lessons.
Topics in This Quiz
- Documents, collections and mongosh
- Inserting and finding documents
- Updating and deleting
- Sorting, indexes and aggregation
Question 1
Exercise
In MongoDB, what is a collection most similar to in a SQL database?
Question 2
Exercise
Which shell command switches to the institute database?
Question 3
Exercise
Which method adds several documents in one call?
Question 4
Exercise
Which filter finds students from Lahore or Islamabad?
Question 5
Exercise
In db.students.find({ city: "Karachi" }, { _id: 0, name: 1 }), what does the second argument do?
Question 6
Exercise
Which update adds "React" to Ali's skills array?
Question 7
Exercise
What does db.students.deleteMany({}) do?
Question 8
Exercise
In the output of explain(), what does COLLSCAN mean?
Question 9
Exercise
In an aggregation pipeline, which stage works like a LEFT JOIN with another collection?
What Next?
Well done on finishing the MongoDB tutorial. Build a full app with Node.js and React, or learn relational databases with the SQL tutorial.
