I want to squash two requests:
a = r.table('A').run(conn)
b = r.table('B').run(conn)
in a single one. Something like:
out = some_reql({
'a': r.table('A'),
'b': r.table('B')
}).run(conn)
out['a']
out['b']
I want to squash two requests:
a = r.table('A').run(conn)
b = r.table('B').run(conn)
in a single one. Something like:
out = some_reql({
'a': r.table('A'),
'b': r.table('B')
}).run(conn)
out['a']
out['b']
If you want to get both back in a single query you can do it with union
like so
r.union(r.table("A"), r.table("B"))
This will give you back a single stream object that's a concatenation of the 2 streams. However you won't be able to tell where one stream ends and the next begins. There's currently no way to return 2 separate stream objects in the same query. So if you want to be able to use them as separate streams you need to do 2 separate queries. Is there a reason that doesn't work for you?
If your streams are big then this won't have a big impact on performance because to evaluate the results of each stream will require multiple requests anyways. However if they're small then you can just coerce them to arrays like so:
{"a" : r.table("A").coerce_to("ARRAY"),
"b" : r.table("B").coerce_to("ARRAY")}
Only do this if your streams will fit in memory.