-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 3.2.0-rc0
-
Component/s: Aggregation Framework, Index Maintenance
-
None
-
Minor Change
Currently the aggregation framework does not enforce any restrictions on the position of the new $indexStats stage within the aggregation pipeline. Since there are currently no uses cases for $indexStats being anything but the first stage in the pipeline, it may make sense for the server to report an error if it's not the first stage.
This is similar to what is done with $out, which is currently required to be the last stage in the pipeline.
We can always relax the restriction in the future if new stages are added which make sense to go before $indexStats