Which Aggregate operation use Indexscan?

Hi @Prof_Monika_Shah,

Please refer to the MongoDB server manual for more information on Pipeline Operators and Indexes and Aggregation Pipeline Optimisation.

Stages that can use an index (and will be included in aggregation explain output) currently include $match, $sort, $group, and $geonear) .

The $lookup and $graphLookup stages can also use indexes on from collections but the aggregation explain output (as at MongoDB 5.0) only describes indexes on the collection the aggregate command is invoked on. There’s an open feature request to improve explain output for $lookup: SERVER-22622.

Stages that transform data (like $project) rely on index usage in previous stages that fetch data (for example, an initial $match + $sort).

Regards,
Stennie