Skip to content
Visit booth 3171 at Google Cloud Next to see how to unlock real-time decisions at scaleMore info

Incompatible API changes

Version 1.0.0

Replace predicate expressions with Aerospike Expressions

The old predicate expression functionality has been replaced by Aerospike Expressions. Aerospike Expressions include all previous predicate expression functionality (with a different, improved syntax) plus support for record metadata expressions and list/map/bit/hyperloglog expression methods analogous to those used in operations.

This version of the client requires server version 5.2.0.4+. Code using old PredExp must be converted to the new syntax. Here is an example:

OLD:

// return records where value of bin "age" is <= 35
let mut statement = Statement::new(namespace, &set_name, Bins::All);
statement.add_predicate(as_predexp_integer_bin!("age".to_string()));
statement.add_predicate(as_predexp_integer_value!(35));
statement.add_predicate(as_predexp_integer_lesseq!());
let qpolicy = QueryPolicy::default();
let results = client.query(&qpolicy, statement)?;

NEW:

use aerospike::expressions as exp;
// return records where value of bin "age" is <= 35
let mut qpolicy = QueryPolicy::default();
qpolicy.filter_expression = Some(
exp::le(
exp::int_bin("age".to_string()),
exp::int_val(35)
)
)
let statement = Statement::new(namespace, &set_name, Bins::All);
let results = client.query(&qpolicy, statement)?;
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?