Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
Query Optimization
Description
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?
Attachments
Issue Links
- related to
-
SERVER-66707 Add ability to nest $group operations
-
- Backlog
-