mongoose-query-parser
mongoose-query-parser copied to clipboard
geoNear Error parse
I'm trying to use geoNear aggregation like this:
filter={
"$geoNear":{
"near": {
"type" : "Point",
"coordinates" : [12.897594,12.897594]
},
"spherical" : false,
"distanceField" : "calcDistance",
"maxDistance" : 240,
"distanceMultiplier" : 0.1
}
}
but when parsed the filter loses the coordinates, this is the result:
{
'$geoNear': {
near: { type: 'Point', coordinates: [] },
spherical: false,
distanceField: 'calcDistance',
maxDistance: 240,
distanceMultiplier: 0.1
}
}
how can i solve this?