object

ReQL command: object

Command syntax

r.object([key, value,]...) → object

Description

Creates an object from a list of key-value pairs, where the keys must be strings. r.object(A, B, C, D) is equivalent to r.expr([[A, B], [C, D]]).coerce_to('OBJECT').

Example: Create a simple object.

> r.object('id', 5, 'data', ['foo', 'bar']).run(conn)
{data: ["foo", "bar"], id: 5}

Related commands

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/ruby/object/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部