-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Query Optimization
Like below code:
db.test.aggregate([ { "$facet": { "allGroups": [ { "$facet": { "group1": [{ "$group":{"_id": "$item1"} }], "group2": [{ "$group":{"_id": "$item2"} }] } } ], "size": [ { "$count": "size" } ] } } ])
This will thrown:
"errmsg" : "specified stage is not allowed to be used within a $facet stage: 0: { $facet: { group1: [ { $group:
Unknown macro: { _id}} ], group2: [ { $group:
Unknown macro: { _id}} ] } }",
"code" : 40331,
"codeName" : "Location40331"
Hope to allow nested $facet happen, is there any downside?
- related to
-
SERVER-66707 Add ability to nest $group operations
- Backlog