-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
When looking to do aggregations on a subset of documents in arrays, the current "best" practice is to do $match first, then $unwind then $match again.
In other words, if our pipeline is:
{$match:{array.Member:"value"}},{$unwind:"$array"},{$match:{"array.Member":"value"}}
if we can optimize this into something that eliminates unneeded array elements along with unneeded fields this could be reduced to one $match and no $unwind.
redbeard0531 this is what we talked about yesterday, please re-write the description if I didn't capture what we were discussing accurately.
- duplicates
-
SERVER-17943 add $filter expression to $project to work with $map and $reduce
- Closed
- related to
-
SERVER-27494 Avoid unwind on multi-key index field for covered index aggregation
- Backlog