Created
June 7, 2022 13:05
-
-
Save alexvenom/5b3db39d1b44dcdf123ad77616ffcd12 to your computer and use it in GitHub Desktop.
This file contains 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
// User's location | |
const userLocation = myUser.get("location"); | |
// Create a query for Restaurants | |
const query = new Parse.Query("Restaurant"); | |
// Interested in locations near the User | |
query.near("location", userLocation); | |
// Limit the result set to 10 objects | |
query.limit(10); | |
// Final list of 10 Restaurants nearest to the User, ordered by Distance ascending | |
const nearRestaurants = await query.find(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment