Explore topic-wise MCQs in Mongodb.

This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Mongodb knowledge and support exam preparation. Choose a topic below to get started.

1.

Specify the ______ operator to the hint() method to prevent MongoDB from using any index.

A. $unique
B. $natural
C. $spatial
D. all of the mentioned
Answer» C. $spatial
2.

To force MongoDB to use a particular index for a db.collection.________ operation, specify the index with the hint() method.

A. query()
B. find()
C. index()
D. all of the mentioned
Answer» C. index()
3.

The __________ operator constrains the results of a geospatial $near or $nearSphere query to the specified distance.

A. $center
B. $maxDistance
C. $minDistance
D. all of the mentioned
Answer» C. $minDistance
4.

__________ views partial execution statistics collected during plan selection.

A. curs.explain()
B. cursor.explain()
C. cursr.explain()
D. all of the mentioned
Answer» C. cursr.explain()
5.

TO_FORCE_MONGODB_TO_USE_A_PARTICULAR_INDEX_FOR_A_DB.COLLECTION._________OPERATION,_SPECIFY_THE_INDEX_WITH_THE_HINT()_METHOD.?$

A. query()
B. find()
C. index()
D. all of the mentioned
Answer» C. index()
6.

Specify_the________operator_to_the_hint()_method_to_prevent_MongoDB_from_using_any_index$

A. $unique
B. $natural
C. $spatial
D. all of the mentioned
Answer» C. $spatial
7.

The __________ operator constrains the results of a geospatial?#near or?#nearSphere query to the specified distance?

A. $center
B. $maxDistance
C. $minDistance
D. all of the mentioned
Answer» C. $minDistance
8.

__________ views partial execution statistics collected during plan selection

A. curs.explain()
B. cursor.explain()
C. cursr.explain()
D. all of the mentioned
Answer» C. cursr.explain()
9.

In the mongo shell, you can use the ______ method to return a list of the indexes on a collection.

A. getallIndexes()
B. getretIndexes()
C. getIndexes()
D. none of the mentioned
Answer» D. none of the mentioned
10.

To terminate an ongoing index build, use the __________ method in the mongo shell.

A. db.currentOp()
B. db.killOp()
C. db.removeOp()
D. all of the mentioned
Answer» C. db.removeOp()
11.

If you need to rebuild indexes for a collection you can use the _________ method to rebuild all indexes on a collection in a single operation.

A. db.collection.Index()
B. db.collection.reIndex()
C. db.collection.rebuildIndex()
D. none of the mentioned
Answer» B. db.collection.reIndex()
12.

To modify an existing index, you cannot just re-issue the _________ method with the updated specification of the index.

A. dropIndex()
B. modIndex()
C. createIndex()
D. none of the mentioned
Answer» D. none of the mentioned