Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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