Closed kingsleyh closed 6 years ago
It is, but using crystal blocks:
r.table("orders").concat_map do |order|
order["items"].map do |item|
{"item_id" => item["item_id"], "quantity" => item["quantity"], "count" => 1}
end
end
Same syntax as in Ruby
aah awesome thanks - I couldn't see it
concat_map doesn't seem to exist though - is there an equivalent?
f9a52b76 :wink:
awesome thanks :) - I'm still getting my head around how the library works!
I notice that
r.table("users").concat_map do |user| user end
complains
'RethinkDB::TableTerm#concat_map' is expected to be invoked with a block, but no block was given
but it works in this format ok:
r.table("users").concat_map{|user| user }
The nested ones seem to work fine with do end though
hi
is this kind of query possible currently?
I searched the repo and found only references to lambda in yaml files so I guess it's not implemented.