I have a table of "person" data, which has a unique key "id". I have a list of id's that I want to get the data for which I'll be sending as a JSON array from the client to the server. The serve recieves that data as a JSON array.
Now is there a way to run a query that will get the documents for each of those ids?
Or is my only option to parse the ids myself and build an array of results, then send that array back.
So far I've tried using...
getAll - but I cannot get this to work because it accepts a dynamic amount of parameters, and I don't know how to change my array of values into a dynamic amount of parameters.
(example... I want to be able to do whats shown below, but I can't)
r.db('vp').table('user').getAll(["0", "0", "99"])
I can only do this...
r.db('vp').table('user').getAll("0", "0", "99")
expr and forEach - as seen below, but I don't think this can work.
var arr = []; r.expr(["0", "0", "99"]).forEach(function(id) { })