| layout | api-command | ||||||
|---|---|---|---|---|---|---|---|
| language | Java | ||||||
| permalink | api/java/get/ | ||||||
| command | get | ||||||
| related_commands |
|
{% apibody %} table.get(key) → singleRowSelection {% endapibody %}
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);Example: Find a document and merge another document with it.
r.table("heroes").get(3).merge(
r.hashMap("powers", r.array("invisibility", "speed"))
).run(conn);Example: Subscribe to a document's changefeed.
r.table("heroes").get(3).changes().run(conn);