How to use left join of sql in Rethinkdb ReQL with secondary index? -
i have 2 table a
, b
i use left join
in sql means content of , common content of b. tried use outer join like:
r.table("a").outerjoin(r.table("b"),function(a,b){ return a("id")==b("anotherfield")("joinfield") })
but query slow there no index in table b
. how can use secondary index when querying outerjoin
?
equivalent sql
select * left join a.id = b.other_field_join
you can map
here: r.table('a').map(function(row) { return {left_row: row, right_rows: r.table('b').getall(row('id'), {index:'idx'})}; })
Comments
Post a Comment