mongoose-query-parser icon indicating copy to clipboard operation
mongoose-query-parser copied to clipboard

geoNear Error parse

Open mitinoh opened this issue 2 years ago • 0 comments

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?

mitinoh avatar Jun 14 '22 12:06 mitinoh