Answers for ""errmsg" : "A pipeline stage specification object must contain exactly one field.","

0

"errmsg" : "A pipeline stage specification object must contain exactly one field.",

// true
db.audiofiles.aggregate([
    {
        "$match": {
            "privacy": { "$ne": "same" },
            "date": { "$eq": "2017/04/25" },
            "deleted": 0
        }
    },
    {
        "$group": { 
            "_id": "$to_email", 
            "count": { "$sum": 1 }
        }
    }
]);

// false
db.audiofiles.aggregate([{
    "$match": {
      "privacy": { "$ne": "same" },
      "date": { "$eq": "2017/04/25" },
      "deleted": 0
     },
    "$group": { 
      "_id": "$to_email", 
      "count": { "$sum": 1 }
    }
}]);
Posted by: Guest on March-22-2021

Code answers related to ""errmsg" : "A pipeline stage specification object must contain exactly one field.","

Code answers related to "Javascript"

Browse Popular Code Answers by Language