Created
May 19, 2018 14:59
-
-
Save awatson1978/052e7979e753cc7445062efe2172540f to your computer and use it in GitHub Desktop.
$near
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var user = Meteor.user(); | |
var centroid = user.profile.locations.home; | |
var coordinatesArray = [centroid.longitude, centroid.latitude]; | |
Locations.find({ | |
location: | |
{ $near : | |
{ | |
$geometry: { type: "Point", coordinates: coordinatesArray }, | |
$minDistance: 1000, | |
$maxDistance: 5000 | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment