Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardMongoDBAggregation pipeline executionSingle-choice MCQ

Given this pipeline, what optimization does the aggregation query planner perform before execution, and what is the consequence for index usage?

db.orders.aggregate([ { $project: { customerId: 1, total: 1, status: 1 } }, { $match: { status: "shipped" } }, { $sort: { total: -1 } } ]) // index: { status: 1, total: -1 } exists