I\'m working on the following document
{
\"_id\" : 12,
\"firstName\" : \"wer\",
\"People\" : [
{
\"uuid\" : \"123\",
\"name\" : \"sugun\
I used the meteorhacks:aggregate package. It works only on the server side.
meteor add meteorhacks:aggregate
MyCollection.aggregate({
$match: {
propertyToQuery: 'valueForProperty'
}, {
$group: {
_id: '$propertyToGroupBy',
result: { $operation: '$propertyToPerformOperationOn' }
}
});
https://github.com/meteorhacks/meteor-aggregate https://themeteorchef.com/snippets/aggregations-in-mongodb/