Aerospike supports searching for exact value for string bins and exact values or range (min,max) for numeric bins. However it doesn’t support using multiple filters in a single query through the client drivers right now.
For that you’ll have to write your own Lua UDF that checks for multiple separate values, but then you can’t use a secondary index because the UDF will have to go through all the records in the set. Also if you’re using an UDF to filter then you can just use the UDF to do the deletion too (which is the second method described above).
I think the best option for you is to just combine the two methods a big and create a basic
delete Lua UDF that can be called via the client in a query. This way it’s just 3 separate calls (for 123, 456, 789) and it’ll use the secondary index to only pass those records to the delete function.
Here’s a quick walkthrough
Save this as
Then register it in your cluster:
RegisterTask task = client.register(null, "C:/dev/udf/delete.lua", "delete.lua", Language.LUA);
Then run the UDF through a query - this will use the index on the bin and send all matching records to that UDF which just immediately deletes the record:
Statement stmt = new Statement();
ExecuteTask task = client.execute(defaultPolicy, stmt, "delete", "deleteRecord");