Answers for "how to find geopoints radius in mongoose"

0

how to find geopoints radius in mongoose

Location.find({
    loc: {
        $near: {
            $geometry: {
                type: "Point",
                coordinates: coords
            },
            $maxDistance: maxDistance
        }
    } 
}).then((err, locations) => {
    // do what you want here
})
Posted by: Guest on October-16-2020
0

how to find geopoints radius in mongoose

var locQuery = (coords, distance) => {
    return { loc: { $near: { $geometry: { type: "Point", coordinates: coords }, $maxDistance: parseInt(distance)}}}
}
Posted by: Guest on October-16-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language