Company: DIT intern hiring test
Difficulty: hard
Compound Index That Covers a Sorted MongoDB Projection Millions of documents are inserted into the customers collection in MongoDB. Each document has the following structure. {"_id": 1, "Name":{"First Name":"Adam", "Last Name":"Grant"}, "Age": 20} An index is created on the customers collection as follows. db.customers.createIndex( { "Name.Last Name" : 1}, { name: "LastNameIndex"} ) Consider the query shown below. db.customers.find({ "Name.Last Name" : "Thom" }, { "_id" : NumberInt(0), "Name.First Name" : NumberInt(1), "Name.Last Name" : NumberInt(1) }).sort({ "Name.Last Name" : NumberInt(1) }); Which of the following additional indexes will improve the execution time of this query?