I have created two secondary indexes (customer and orderID). It works well with single filter but when I try to chain two or more filters I run into the following bug:
{ code: 4,
message: 'AEROSPIKE_ERR_REQUEST_INVALID',
func: 'as_query_parse_records',
file: 'src/main/aerospike/aerospike_query.c',
line: 223 }
Here is the query that I’m trying to execute:
var aerospike = require('aerospike');
var statement = {};
statement.filters = [
aerospike.filter.equal('customer', 'ABC Customer'),
aerospike.filter.range('orderID', 604221, 604224)
];
var query = client.query('test', 'orders', statement);
var dataCallback = function(record) {
// process the scanned record
console.log(record);
}
var errorCallback = function(error) {
// process the error
console.log(error);
}
var endCallback = function() {
//process the end of query results.
console.log('end!!!!');
}
var stream = query.execute(); // returns a stream object.
stream.on('data', dataCallback);
stream.on('error', errorCallback);
stream.on('end', endCallback);
Is chaining filters supported by the NodeJS client API? Or am I doing something wrong?
Regards!