I'm trying to do an aggregation with mongo-go-driver (MongoDB team driver for Golang) and I can't see what I'm doing wrong here:
// group
group, e := bson.ParseExtJSONObject(`
{
"$group": {
"_id":{
"ProductCode":"$ProductCode",
"Dir":"$Dir",
"WharehouseID":"$WharehouseID"
}
}
}
`)
cursor, e := myCollection.Aggregate(
context.Background(),
group,
)
// e output: "(Location40324) Unrecognized pipeline stage name: '_id'"
This is a mongodb error but if I execute this query in a mongodb native client I get the results and no error occurs.