Multiple "where" clause query


#1

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"));

Arglist to a lua function
#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


#3

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


#4

Will try to port the example over.


#5

Has there been any update to this?


#6

Still on the radar for us.


#7

@jaylucas

Here is the code for the C example on GitHub.