Struct reql::Command [−][src]
pub struct Command { /* fields omitted */ }
Expand description
The query that will be sent to RethinkDB
Implementations
Create a table
A RethinkDB table is a collection of JSON documents.
Example
Create a table named “dc_universe” with the default settings.
r.db("heroes").table_create("dc_universe").run(conn)
{
"config_changes": [
{
"new_val": {
"db": "test",
"durability": "hard",
"id": "20ea60d4-3b76-4817-8828-98a236df0297",
"name": "dc_universe",
"primary_key": "id",
"shards": [
{
"primary_replica": "rethinkdb_srv1",
"replicas": [
"rethinkdb_srv1",
"rethinkdb_srv2"
]
}
],
"write_acks": "majority"
},
"old_val": None
}
],
"tables_created": 1
}
```
Orders the result based on the given column.
Argument can either be a string, r.asc("column")
for ascending or r.desc("column")
for descending.
If the given argument is a string, the direction will default to ascending.
Example
Sort the result in descending order based on the created_at
column.
r.db("database").table("users").order_by(r.desc("created_at")).run(conn)
Limits the result set to the given amount.
Argument can be an isize.
Example
Get 5 records.
r.db("database").table("users").limit(5).run(conn)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Command
impl !UnwindSafe for Command
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more