do

ReQL command: do

Command syntax

any.do(function) → any
r.do([args]*, function) → any
any.do(expr) → any
r.do([args]*, expr) → any

Description

Call an anonymous function using return values from other ReQL commands or queries as arguments.

The last argument to do (or, in some forms, the only argument) is an expression or an anonymous function which receives values from either the previous arguments or from prefixed commands chained before do. The do command is essentially a single-element map, letting you map a function over just one document. This allows you to bind a query result to a local variable within the scope of 登录查看完整内容