I am working on a query to a mongodb with mgo using golang but it throws Unsupported projection option
error while querying a sub document.
I am working on below document
{
"_id" : ObjectId("5b64a0d3931653c36bcaf0b5"),
"quantity" : 2,
"product" : "ABC",
"children" : [
{
"isBlocked" : true,
"blockedMessage" : "Error occurred: TRACEID",
"serialNo" : "abc123",
"token" : "foo456",
}
]
}
The query I am using is
bson.M{"_id": 0, "children": bson.M{"serialNo": "abc123"}}
May I know where the mistake is?