Loading

Quipoin Menu

Learn • Practice • Grow

mongodb / Indexing for Performance
mcq
Direction: Choose the correct option

Q1.

What is an index in MongoDB?
A. A backup of the database
B. A data structure that improves the speed of queries
C. A copy of a collection
D. A relationship between collections
Direction: Choose the correct option

Q2.

Which method creates an index on a field?
A. db.collection.addIndex()
B. db.collection.createIndex()
C. db.collection.indexField()
D. db.collection.newIndex()
Direction: Choose the correct option

Q3.

What is a unique index?
A. An index that prevents duplicate values for the indexed field(s)
B. An index that can only be used once
C. An index that is automatically deleted
D. An index on a single field
Direction: Choose the correct option

Q4.

How can you check which indexes exist on a collection?
A. db.collection.showIndexes()
B. db.collection.indexes()
C. db.collection.listIndexes()
D. db.collection.getIndexes()
Direction: Choose the correct option

Q5.

What is a compound index?
A. An index that combines two collections
B. An index that uses multiple data types
C. An index that is compressed
D. An index on multiple fields