On this page
ReQL command: table
Command syntax
db.table(name[, {:read_mode => 'single', :identifier_format => 'name'}) → table
Description
Return all documents in a table. Other commands may be chained after table
to return a subset of documents (such as get and filter) or perform further processing.
Example: Return all documents in the table ‘marvel’ of the default database.
r.table('marvel').run(conn)
Example: Return all documents in the table ‘marvel’ of the database ‘heroes’.
r.db('heroes').table('marvel').run(conn)
There are two optional arguments.
read_mode
: One of three possible values affecting the consistency guarantee for the table read:single
returns values that are in memory (but not necessarily written to disk) on the primary replica. This is the default.majority
will only return values that are safely committed on disk on a majority of replicas. This requires sending a message to every replica on each read, so it is the slowest but most consistent.outdated
will return values that are in memory on an arbitrarily-selected replica. This is the fastest but least consistent.
identifier_format
: possible values arename
anduuid
, with a default ofname
. If set touuid
, then system tables will refer to servers, databases and tables by UUID rather than name. (This only has an effect when used with system tables.)
Example: Allow potentially out-of-date data in exchange for faster reads.
r.db('heroes').table('marvel', {:read_mode => 'outdated'}).run(conn)
© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/ruby/table/