|
issues trying to use $set & $unset in Compass Aggregation builder (Compass v1.20.5 & 1.21.0-beta.4 - Ubuntu 18.04)?
Mongo Shell happily executes my pipeline but Compass doesn't like it and reports format errors.
// agg pipeline that works in shell but when imported into Compass causes problems:
|
[{$unwind: {
|
path: '$members'
|
}}, {$unwind: {
|
path: '$members.name'
|
}}, {$group: {
|
_id: '$members.name',
|
number: {$sum: 1}
|
}}, {$sort: {
|
number: -1
|
}}, {$limit: 10
|
}, {$set: {
|
name: '$_id.val'
|
}}, {$unset: ['_id']
|
}]
|
See attached screenshot showing Compass errors.
Note, when imported into Compass, no errors are initially shown but the pipeline doesn't produce results. Go into the $set or $unset stage, remove an apostrophe character (or whatever) and then re-add the same identical character and the Compass errors will then be shown.
|