Module reql::commands
[−]
[src]
The ReQL command reference
Structs
Args |
The return type of the |
Command |
The type returned by every error |
Traits
Add |
Sum two or more numbers, or concatenate two or more strings or arrays |
And |
Compute the logical "and" of one or more values |
Append |
Append a value to an array |
Avg |
Average all the elements of a sequence |
Between |
Get all documents between two keys |
Binary |
Encapsulate binary data within a query |
Branch |
Perform a branching conditional equivalent to if-then-else |
Ceil |
Round the given value up, returning the smallest integer value greater than or equal to the given value (the value's ceiling) |
ChangeAt |
Change a value in an array at a given index |
Changes |
Turn a query into a changefeed, an infinite stream of objects representing changes to the query’s results as they occur |
Circle |
Construct a circular line or polygon |
CoerceTo |
Convert a value of one type into another |
ConcatMap |
Concatenate one or more elements into a single sequence using a mapping function |
Config |
Query (read and/or update) the configurations for individual tables or databases |
Contains |
Check if a sequence contains all the specified values |
Count |
Counts the number of elements in a sequence or key/value pairs in an object, or returns the size of a string or binary object |
Date |
Return a new time object only based on the day, month and year |
Day |
Return the day of a time object as a number between 1 and 31 |
DayOfWeek |
Return the day of week of a time object as a number between 1 and 7 |
DayOfYear |
Return the day of the year of a time object as a number between 1 and 366 |
Db |
Reference a database |
DbCreate |
Create a database. A RethinkDB database is a collection of tables, similar to relational databases |
DbDrop |
Drop a database |
DbList |
List all database names in the system |
Default |
Provide a default value in case of non-existence errors |
Delete |
Delete one or more documents from a table |
DeleteAt |
Remove one or more elements from an array at a given index |
Difference |
Remove the elements of one array from another array |
Distance |
Compute the distance between a point and another geometry object |
Distinct |
Remove duplicate elements from a sequence |
Div |
Divide two numbers |
Do |
Call an anonymous function using return values from other ReQL commands or queries as arguments |
Downcase |
Lowercase a string |
During |
Return whether a time is between two other times |
EpochTime |
Create a time object based on seconds since epoch |
Eq |
Test if two or more values are equal |
EqJoin |
Join tables using a field or function on the left-hand sequence matching primary keys or secondary indexes on the right-hand table |
Error |
Throw a runtime error |
Expr |
Construct a ReQL JSON object from a native object |
Fill |
Convert a Line object into a Polygon object |
Filter |
Return all the elements in a sequence for which the given predicate is true |
Floor |
Rounds the given value down, returning the largest integer value less than or equal to the given value (the value's floor) |
Fold |
Apply a function to a sequence in order, maintaining state via an accumulator |
ForEach |
Loop over a sequence, evaluating the given write query for each element |
Ge |
Compare values, testing if the left-hand value is greater than or equal to the right-hand |
Geojson |
Convert a GeoJSON object to a ReQL geometry object |
Get |
Get a document by primary key |
GetAll |
Get all documents where the given value matches the value of the requested index |
GetField |
Get a single field from an object |
GetIntersecting |
Get all documents where the given geometry object intersects the geometry object of the requested geospatial index |
GetNearest |
Return a list of documents closest to a specified point based on a geospatial index, sorted in order of increasing distance |
Grant |
Grant or deny access permissions for a user account, globally or on a per-database or per-table basis |
Group |
Take a stream and partitions it into multiple groups based on the fields or functions provided |
Gt |
Compare values, testing if the left-hand value is greater than the right-hand |
HasFields |
Test if an object has one or more fields |
Hours |
Return the hour in a time object as a number between 0 and 23 |
Http |
Retrieve data from the specified URL over HTTP |
InTimezone |
Return a new time object with a different timezone |
Includes |
Test whether a geometry object is completely contained within another |
IndexCreate |
Create a new secondary index on a table |
IndexDrop |
Delete a previously created secondary index of this table |
IndexList |
List all the secondary indexes of this table |
IndexRename |
Rename an existing secondary index on a table |
IndexStatus |
Get the status of the specified indexes on this table, or the status of all indexes on this table if no indexes are specified |
IndexWait |
Wait for the specified indexes on this table to be ready, or for all indexes on this table to be ready if no indexes are specified |
Info |
Get information about a ReQL value |
InnerJoin |
Returns an inner join of two sequences |
Insert |
Insert documents into a table |
InsertAt |
Insert a value in to an array at a given index |
Intersects |
Test whether two geometry objects intersect with one another |
IsEmpty |
Test if a sequence is empty |
Iso8601 |
Create a time object based on an ISO 8601 date-time string |
Js |
Create a javascript expression |
Json |
Parse a JSON string on the server |
Keys |
Return an array containing all of an object’s keys |
Le |
Compare values, testing if the left-hand value is less than or equal to the right-hand |
Limit |
End the sequence after the given number of elements |
Line |
Construct a geometry object of type Line |
Literal |
Replace an object in a field instead of merging it with an existing object in a merge or update operation |
Lt |
Compare values, testing if the left-hand value is less than the right-hand |
Map |
Transform each element of one or more sequences by applying a mapping function to them |
Match |
Match against a regular expression |
Max |
Find the maximum element of a sequence |
Merge |
Merge two or more objects together to construct a new object with properties from all |
Min |
Find the minimum element of a sequence |
Minutes |
Return the minute in a time object as a number between 0 and 59 |
Mod |
Find the remainder when dividing two numbers |
Month |
Return the month of a time object as a number between 1 and 12 |
Mul |
Multiply two numbers, or make a periodic array |
Ne |
Test if two or more values are not equal |
Not |
Compute the logical inverse (not) of an expression |
Now |
Return a time object representing the current time in UTC |
Nth |
Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element |
OffsetsOf |
Get the indexes of an element in a sequence. If the argument is a predicate, get the indexes of all elements matching it |
Or |
Compute the logical "or" of one or more values |
OrderBy |
Sort the sequence by document values of the given key(s) |
OuterJoin |
Return a left outer join of two sequences |
Pluck |
Pluck out one or more attributes from either an object or a sequence of objects (projection) |
Point |
Construct a geometry object of type Point |
Polygon |
Construct a geometry object of type Polygon |
PolygonSub |
Use |
Prepend |
Prepend a value to an array |
Random |
Generate a random number between given (or implied) bounds |
Range |
Generate a stream of sequential integers in a specified range |
Rebalance |
Rebalance the shards of a table |
Reconfigure |
Reconfigure a table's sharding and replication |
Reduce |
Produce a single value from a sequence through repeated application of a reduction function |
Replace |
Replace documents in a table |
Round |
Round the given value to the nearest whole integer |
Sample |
Select a given number of elements from a sequence with uniform random distribution |
Seconds |
Return the seconds in a time object as a number between 0 and 59.999 (double precision) |
SetDifference |
Remove the elements of one array from another and return them as a set (an array with distinct values) |
SetInsert |
Add a value to an array and return it as a set (an array with distinct values) |
SetIntersection |
Intersect two arrays returning values that occur in both of them as a set (an array with distinct values) |
SetUnion |
Add a several values to an array and return it as a set (an array with distinct values) |
Skip |
Skip a number of elements from the head of the sequence |
Slice |
Return the elements of a sequence within the specified range |
SpliceAt |
Insert several values in to an array at a given index |
Split |
Split a string into substrings |
Status |
Return the status of a table |
Sub |
Subtract two numbers |
Sum |
Sum all the elements of a sequence |
Sync |
Ensure that writes on a given table are written to permanent storage |
Table |
Return all documents in a table |
TableCreate |
Create a table |
TableDrop |
Drop a table |
TableList |
List all table names in a database |
Time |
Create a time object for a specific time |
TimeOfDay |
Return the number of seconds elapsed since the beginning of the day stored in the time object |
Timezone |
Return the timezone of the time object |
ToEpochTime |
Convert a time object to its epoch time |
ToGeojson |
Convert a ReQL geometry object to a GeoJSON object |
ToIso8601 |
Convert a time object to a string in ISO 8601 format |
ToJson |
Convert a ReQL value or object to a JSON string |
TypeOf |
Gets the type of a ReQL query's return value |
Ungroup |
Takes a grouped stream or grouped data and turns it into an array of objects representing the groups |
Union |
Merge two or more sequences |
Upcase |
Uppercase a string |
Update |
Update JSON documents in a table |
Uuid |
Return a UUID (universally unique identifier), a string that can be used as a unique ID |
Values |
Return an array containing all of an object’s values |
Wait |
Wait for a table or all the tables in a database to be ready |
WithArgs |
Specify optional arguments to a ReQL command |
WithFields |
Plucks one or more attributes from a sequence of objects, filtering out any objects in the sequence that do not have the specified fields |
Without |
Take an object or a sequence of objects, and returns them with the specified paths removed |
Year |
Return the year of a time object |
Zip |
'Zip' up the result of a join by merging the 'right' fields into 'left' fields of each member of the sequence |