Created
October 22, 2015 04:10
-
-
Save paambaati/591f062838204feacaf4 to your computer and use it in GitHub Desktop.
Applying a filter on .getNearest() using RethinkDB and Thinky
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
const userId = '2ff8902e-97f0-431a-a51c-900a57532967'; | |
const location = r.point(-20, 39); | |
const queryOptions = {index: 'location'}; | |
// Getting nearest list of users, while also excluding `userId`. | |
UserModel.getNearest(location, queryOptions) | |
.filter(r.row('doc')('id').ne(userId)) | |
.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment