group("$status",
sum("unread", "$numunread"),
sum("tickets", 1))
))
Is there a way to set name of group id to something else besides _id?
Hi Colin,
The _id
field is part of $group expression and it’s mandatory.
However, you can append a $project stage into the pipeline to rename the _id
field.
See also MongoDB Scala Driver 2.2: Aggregate project()
Regards,
Wan.