Question: In the MongoDB shell, how can you tell if an index was used with a query?

  1. db.customers.find({lastName: 'smith'}).explain()
  2. db.customers.find({lastName: 'smith'}).perf()
  3. db.customers.find({lastName: 'smith'}).plan()
  4. db.customers.find({lastName: 'smith'}).usedIndex()

Answer: The correct answer of the above question is Option A:db.customers.find({lastName: 'smith'}).explain()