I have the following query:
db.getCollection('spawnlocations').find({
'location': {
'$geoWithin': {
'$center': [[-73.94075, 40.789138], 5000]
}
},
"expirationtimems": { "$gte": 1234567890 },
"_id": { "$gte": "2a920240836c40d8b374203a798a27fa.16" }
}).sort({"_id":1}).limit(50)
I am trying to convert the query to mgo using bson.M
but I'm having a hard time with the array part of it.
I thought this would work, but of course it doesn't
q = bson.M{
"location": bson.M{
"$geoWithin": bson.M{
"$center": [
j.Location.Coordinates,
5000
],
},
},
"expirationtimems": bson.M{
"$gte": time.Now().Unix() * 1000,
},
"_id": bson.M{
"$gt": p,
},
}