optArg

ReQL command: optArg

Command syntax

term.optArg(option, value)

Description

Specify an optional argument to a Java ReQL term.

Some terms in ReQL accept optional arguments. Since Java doesn’t support named arguments, the RethinkDB Java driver allows you to pass them by chaining the optArg command after them.

Example: Pass the right_bound optional argument to between.

r.table("marvel").between(10, 20).optArg("right_bound", "closed").run(conn);

To pass more than one optional argument, chain optArg once for each argument.

Example: Pass the right_bound and index optional arguments to between.

r.table("marvel").between(10, 20).optArg("right_bound", "closed")
 .optArg("index", "power").run(conn);

Get more help

Couldn't find what you were looking for?

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/java/optarg/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部