Skip to content

Instantly share code, notes, and snippets.

@neumino
Created May 23, 2013 19:40
Show Gist options
  • Save neumino/5638847 to your computer and use it in GitHub Desktop.
Save neumino/5638847 to your computer and use it in GitHub Desktop.
// Suppose needed_category = [1,2,3]
r.db('foo').table('bar')
.filter( function(movie) {
r.expr( needed_category ).map( function(category) {
return category.eq(movie('category');
}).redunce( function(left, right)
return left.or(right);
}, false)
}).run( connection, function(err, cursor) { ... } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment