Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (33 sloc) 871 Bytes
layout language permalink command io related_commands
api-command
JavaScript
api/javascript/get/
get
table
singleSelection
getAll between
get_all/
between/

Command syntax

{% apibody %} table.get(key) → singleRowSelection {% endapibody %}

Description

Get a document by primary key.

If no document exists with that primary key, get will return null.

Example: Find a document by UUID.

r.table('posts').get('a9849eef-7176-4411-935b-79a6e3c56a74').run(conn, callback);

Example: Find a document and merge another document with it.

r.table('heroes').get(3).merge(
    { powers: ['invisibility', 'speed'] }
).run(conn, callback);

_Example: Subscribe to a document's changefeed.

r.table('heroes').get(3).changes().run(conn, callback);
You can’t perform that action at this time.