[−][src]Struct aerospike::Statement
Query statement parameters.
Fields
namespace: String
Namespace
set_name: String
Set name
index_name: Option<String>
Optional index name
bins: Bins
Optional list of bin names to return in query.
filters: Option<Vec<Filter>>
Optional list of query filters. Currently, only one filter is allowed by the server on a secondary index lookup.
aggregation: Option<Aggregation>
Optional Lua aggregation function parameters.
predexp: Vec<Arc<Box<dyn PredExp>>>
Predicate Filter
Implementations
impl Statement
[src]
pub fn new(namespace: &str, set_name: &str, bins: Bins) -> Self
[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"]));
pub fn add_filter(&mut self, filter: Filter)
[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));
pub fn add_predicate<S: PredExp + 'static>(&mut self, predicate: S)
[src]
Add a Predicate filter to the statement.
Example
This Example uses a simple predexp Filter to find all records in namespace foo and set bar where the age Bin is equal to 32.
let mut stmt = Statement::new("foo", "bar", Bins::from(["name", "age"])); stmt.add_predicate(as_predexp_integer_bin!("age".to_string())); stmt.add_predicate(as_predexp_integer_value!(32)); stmt.add_predicate(as_predexp_integer_equal!());
pub fn set_aggregate_function(
&mut self,
package_name: &str,
function_name: &str,
function_args: Option<&[Value]>
)
[src]
&mut self,
package_name: &str,
function_name: &str,
function_args: Option<&[Value]>
)
Set Lua aggregation function parameters.
Auto Trait Implementations
impl !RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl !UnwindSafe for Statement
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,