I'm having an error when I'm putting my aggregation in mongodbChart. This code is working fine in normal aggregation but when I'm putting it in MongodbCharts it gives me an error.
FunctionError: (InvalidPipelineOperator) Invalid $addFields :: caused by :: Unrecognized expression '$group'
code
{
"$group": {
"_id": "$displayName",
"count": {
"$sum": 1
}
}
},
{
"$match": {
"_id": {
"$ne": null
},
"count": {
"$gt": 1
}
}
}