Open In App

Database | Indexing Explain plan | Question 6

Suppose you have a MongoDB database, having a collection named as Movies, then select the command which would help in finding the movies which are developed in 1983, the collection contains a column as Year.

 



(A)

db.movies.find(“Year” : “1983”);



(B)

db.movies.find{“Year” : “1983”};

(C)

db.movies.find({“Year” : “1983”});

(D)

db.movies.findOne({“Year” : “1983”});

Answer: (C)
Explanation:

db.movies.find({“Year” : “1983”}), this command would find the movies year whose year is 1983, then only print the selections.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :