-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
I am trying to make an aggregate query using this simple array:
[ [ '$match' => ['deck_id' => 18], ], [ '$project' => [ 'stack' => 1, ] ], [ '$unwind' => '$stack' ], [ '$group' => [ '_id' => '$stack.response', 'responses' => [ '$push' => '$$ROOT.stack' ] ] ], [ '$project' => [ 'responses_count' => ['$size' => '$responses'] ] ] ]
But I am getting the following exception: Unrecognized pipeline stage name: '$unwind'
**The following query in Robo 3T(an client for mongodb) works on the same server:
db.getCollection('game_statistics').aggregate([ {$match: {deck_id: 18}}, {$project: {stack: 1}}, {$unwind: "$stack"}, {$group: {_id: "$stack.response", responses: {$push: "$$ROOT.stack"}}}, {$project: {responses_count: {'$size': "$responses"}}} ])
- links to