A pipeline stage specification object must contain exactly one field code example
Example: "errmsg" : "A pipeline stage specification object must contain exactly one field.",
db.audiofiles.aggregate([
{
"$match": {
"privacy": { "$ne": "same" },
"date": { "$eq": "2017/04/25" },
"deleted": 0
}
},
{
"$group": {
"_id": "$to_email",
"count": { "$sum": 1 }
}
}
]);
db.audiofiles.aggregate([{
"$match": {
"privacy": { "$ne": "same" },
"date": { "$eq": "2017/04/25" },
"deleted": 0
},
"$group": {
"_id": "$to_email",
"count": { "$sum": 1 }
}
}]);