The Field "$_id" must be an accumulator object

Viewed 31701

I am trying to group some documents within mongoDB, right after a $match stage like this:

db.trips.aggregate([
  { "$match": {
      "Stop Time": {
        "$lt": "31.07.2013 23:59"
      }
    }
  },
    {   "$group": {
          "$_id": { "Start": "$Start", "End": "$End" },
    }
  }]

However I am getting the following error:

"The field '$_id' must be an accumulator object"

Why does this error show up, and why does it only show up when I include the match stage? Without the match stage, it works just fine.

1 Answers
Related