Question: In the MongoDB shell, how can you tell if an index was used with a query?
- db.customers.find({lastName: 'smith'}).explain()
- db.customers.find({lastName: 'smith'}).perf()
- db.customers.find({lastName: 'smith'}).plan()
- db.customers.find({lastName: 'smith'}).usedIndex()
Answer: The correct answer of the above question is Option A:db.customers.find({lastName: 'smith'}).explain()