I don’t know if I am reading the documentation incorrectly but is it possible to have multiple where statements in a query?
Basically
as_query_where(&query, "bin1", as_string_equals("somestring"));
//and
as_query_where(&query, "bin2", as_string_equals("anotherstring"));
wchu
April 2, 2015, 8:32pm
2
Multiple where clauses is currently not supported at the database level.
This can currently be done via udf/aggregation framework as in the example below:
http://www.aerospike.com/community/labs/query_multiple_filters.html
I actually saw this example. Would it be possible to give me an example in C instead of Java. I just want to send an argument to the lua function if this is the case.
This is what I have so far:
as_query query;
as_query_init(&query, asNamespace, asSet);
as_query_where_inita(&query, 1);
as_query_where(&query, binName, as_string_equals(where_val));
as_arraylist arglist;
as_arraylist_inita(&arglist, 1);
as_arraylist_append_string(&arglist, where_val2);
as_query_apply(&query, UDF_MODULE, lua_function, &arglist);
if (aerospike_query_foreach(&as, &err, NULL, &query, query_cb_map, NULL) !=
But this is not doing anything
wchu
April 3, 2015, 11:15pm
4
Will try to port the example over.
Has there been any update to this?
wchu
April 30, 2015, 4:58am
6
Still on the radar for us.
1 Like
amine
June 16, 2015, 10:41pm
7
@jaylucas
Here is the code for the C example on GitHub.
1 Like