-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query Optimization
If I have a pipeline
{$group:{_id:"any", a:{$push:"$x"}}}, {$project:{a:{$slice:["$a",0,5]}}}
We can pull in knowledge that only first 5 elements are needed from "a" in $group and stop pushing more elements after we have that many.