Struct aerospike::Statement [] [src]

pub struct Statement {
    pub namespace: String,
    pub set_name: String,
    pub index_name: Option<String>,
    pub bins: Bins,
    pub filters: Option<Vec<Filter>>,
    pub aggregation: Option<Aggregation>,
}

Query statement parameters.

Fields

Namespace

Set name

Optional index name

Optional list of bin names to return in query.

Optional list of query filters. Currently, only one filter is allowed by the server on a secondary index lookup.

Optional Lua aggregation function parameters.

Methods

impl Statement
[src]

[src]

Create a new query statement with the given namespace, set name and optional list of bin names.

Examples

Create a new statement to query the namespace "foo" and set "bar" and return the "name" and "age" bins for each matching record.


let stmt = Statement::new("foo", "bar", Bins::from(["name", "age"]));

[src]

Add a query filter to the statement. Currently, only one filter is allowed by the server on a secondary index lookup.

Example

This example uses a numeric index on bin baz in namespace foo within set bar to find all records using a filter with the range 0 to 100 inclusive:

let mut stmt = Statement::new("foo", "bar", Bins::from(["name", "age"]));
stmt.add_filter(as_range!("baz", 0, 100));

[src]

Set Lua aggregation function parameters.

Trait Implementations

impl Clone for Statement
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more