Question 1mediummultiple choice
Read the full Indexing explanation →C100DEV Indexing • Complete Question Bank
Complete C100DEV Indexing question bank — all 0 questions with answers and detailed explanations.
{
"queryPlanner": {
"winningPlan": {
"stage": "FETCH",
"inputStage": {
"stage": "IXSCAN",
"keyPattern": { "userId": 1, "timestamp": -1 },
"indexName": "userId_1_timestamp_-1",
"direction": "forward"
}
}
},
"executionStats": {
"nReturned": 50,
"totalKeysExamined": 50,
"totalDocsExamined": 50
}
}db.users.find({age: {$gt: 25}, status: 'active'}).sort({name: 1})db.products.createIndex({category: 1, price: -1})// Document structure
{
"_id": 1,
"metadata": { "type": "book", "genre": "fantasy" }
}
// Index creation
db.collection.createIndex({ "metadata": 1 })