Google News
logo
MongoDB - Quiz(MCQ)
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()
B)
db.collection.reIndex()
C)
db.collection.rebuildIndex()
D)
db.collection.Index()

Correct Answer :   db.collection.Index()


Explanation : This operation drops all indexes, including the _id index, and then rebuilds all indexes.

Advertisement