Nokdu
Nokdu

Reputation: 98

is there anyway i can pass an array to getAll()?

I am looking for a good way to do the following.

  1. Get a list of uids from tableA like..

r.Table('tableA').get(1)('somelistofuid')

  1. Then I want to use the list go get all the data I need from tableB

r.Table('tableB').getAll(listfromQueryAbove)

I know that i can do getAll(a,b,c) to get a,b,c but could there be a simpler way?

Upvotes: 1

Views: 695

Answers (2)

kureikain
kureikain

Reputation: 2314

You want something to unpack an array into an argument list, that's args.

So change your query to

r.Table('tableB').getAll(r.args(listfromQueryAbove))

and it should work.

Upvotes: 8

mlucy
mlucy

Reputation: 5289

You can use r.args for this:

r.table('table').getAll(r.args(ARRAY))

Upvotes: 2

Related Questions