Skip to content

Instantly share code, notes, and snippets.

@paambaati
Created October 22, 2015 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paambaati/591f062838204feacaf4 to your computer and use it in GitHub Desktop.
Save paambaati/591f062838204feacaf4 to your computer and use it in GitHub Desktop.
Applying a filter on .getNearest() using RethinkDB and Thinky
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