Query Operations

Last Updated :
Discuss
Comments

Question 1

What is the purpose of query operations in MongoDB?

  • Insert data

  • Delete data

  • Retrieve and filter data

  • Modify data

Question 2

Which method is used to retrieve multiple documents?

  • findOne()

  • find()

  • get()

  • search()

Question 3

Which method returns only one document?

  • find()

  • findAll()

  • findOne()

  • getOne()

Question 4

Which method is used to update and return the document in one step?

  • updateOne()

  • findAndModify()

  • replaceOne()

  • insertOne()

Question 5

Which method deletes and returns a document?

  • deleteOne()

  • findOneAndDelete()

  • removeOne()

  • drop()

Question 6

Which method updates and returns one document?

  • findOneAndUpdate()

  • updateMany()

  • modifyOne()

  • replaceMany()

Question 7

Which method replaces and returns a document?

  • replaceOne()

  • findOneAndReplace()

  • updateOne()

  • findAndModify()

Question 8

How do you query nested/embedded documents?

  • Using SQL syntax

  • Using dot notation

  • Using arrays only

  • Using joins

Question 9

Which operator is used to query arrays?

  • $arr

  • $list

  • $in

  • $array

Question 10

How do you check for null values in MongoDB?

  • $null

  • null keyword

  • $exists:false

  • $isNull

There are 15 questions to complete.

Take a part in the ongoing discussion