I am selecting multiple documents from an array of keys using (as suggested in this answer):
r.expr([person-id1, person-id2, person-id3])
.eqJoin(function(doc) { return doc; }, r.table("person"))
.zip()
Then joining to a second table by
r.expr([person-id1, person-id2, person-id3])
.eqJoin(function(doc) { return doc; }, r.table("person"))
.zip()
.eqJoin("company_id", r.table("employers"))
.zip()
Which all works great. The only change I'd like to make to optimize the query, is that I only need the employer_name
from the employers table, as there is a considerable size of data that is otherwise associated with an "employers" document. Because this query only consists of eqJoins()
, and no "base" table, is there a way to accomplish it?