r.table("data").map(function(doc) {
return r.object(doc("country"), true) // return { <country>: true}
}).reduce(function(left, right) {
return left.merge(right)
}).keys() // return all the keys of the final document
- Doesn't support uniqueness
- http://stackoverflow.com/questions/20347960/rql-get-multple-documents-from-list-of-keys-rethinkdb-in-javascript http://rethinkdb.com/api/javascript/get_all/
var ids = [1,2,3];
r.table("person").getAll(r.args(ids)).run(connection, callback)
- Examples:
http://blog.justonepixel.com/geek/2013/07/30/blog-example-with-thinky/