-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.19.12
-
Component/s: Aggregation pipeline, Grammar
-
None
-
Environment:MacOs Catalina 10.15.1
using mongoDB 4.2.1 and Compass 1.19.12, I noticed that the $round operator is not working with the aggregation pipeline builder. same . I tried also Compass 1.20 beta 9, same result.
sample document:
{{{
"_id" : ObjectId("5ddbe2272d639f32f2f8cb00"),
"bucket" : ISODate("2019-11-25T14:16:00Z"),
"measure" : "SE03_a_RMS_Freq_01",
"path" : "TL1/Z01/HCZ01/KAV01",
"count" : 3,
"sum" : 77,
"raw" : [
,
,
{ "ts" : ISODate("2019-11-25T14:16:07.885Z"), "v" : 39, "program" : "01", "programBT" : ISODate("2019-11-25T14:16:00Z") } ]
}}}
example aggregation pipeline (working with mongoshell):
{{ [{$match: {
bucket:
,
measure: RegExp('^SE01')
}}, {$sort: {
bucket: -1
}}, {$unwind: {
path: '$raw'
}}, {$group: {
_id:
,
avg:
,
min:
,
max:
}}, {$project: {
val : {$round : ['$avg',2]}
}}]}}
error on compass, last projection stage:
Expected "[" or AggregationStage but "{" found.
- backports
-
COMPASS-5492 $round and $dateSubtract not working in aggregation
- Closed
- causes
-
COMPASS-4146 Disable validation in agg builder, query bar and schema validation
- Closed
- is duplicated by
-
COMPASS-3980 $round not working in aggregation
- Closed