Skip to content

TypeScript code snippet – 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
})
See also  How to print data type in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.