Hello, when I search the database by pipeline and aggregation, I will get this error when I execute cursor.Decode to my struct. But if I search the db by collection.Find (ctx, filter), then no such error when executing the cursor Decode.
The data stored in db is something like:
{
"_id" : "AAX",
"user_id" : ObjectId("5cc6ebf58a158c00010b3d74"),
"name" : "mon super Bureau",
"status" : "active",
"location" : {
"type" : "Point",
"coordinates" : [
48.1259880065918,
-1.6275769472122192
],
"accuracy" : 14
},
"creation_date" : ISODate("2019-05-28T14:26:03.579Z")
}
The result returned looks like:
{
"id": "AAX",
"user_id": "5cc6ebf58a158c00010b3d74",
"name" : "mon super Bureau",
"status": "active",
"location": {
"type": "Point",
"coordinates": [
48.125988,
-1.627576
],
"accuracy": 14
},
"creation_date": {
"seconds": 1559053563,
"nanos": 579000000
},
}
It looks the lng and lat in location has been truncated and cause such error. But why if I use Find, such error will not happen? any parameters should I set for the pipeline and aggregation?
thanks,
James