0
Q:

how to find geopoints radius in mongoose

var locQuery = (coords, distance) => {
    return { loc: { $near: { $geometry: { type: "Point", coordinates: coords }, $maxDistance: parseInt(distance)}}}
}
0
Location.find({
    loc: {
        $near: {
            $geometry: {
                type: "Point",
                coordinates: coords
            },
            $maxDistance: maxDistance
        }
    } 
}).then((err, locations) => {
    // do what you want here
})
0

New to Communities?

Join the community