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.
$_id is not an accumulator function it should be _id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With