BatchOperation that allows a BatchGet and Delete?

New to the community and have been poking around the source code of the golang client library for a while.

I am wondering if there is a function to preform multiple operations using batchget. In the docs (and the code in client.go) there is a way to preform a Get and Delete in a single request to the database, but this functionality seems to not be there for a ‘BatchGet’. I am piecing together an idea that involves calling calling a stream UDF on the result of my batchget, but it seems the ‘aerospike way’ is to use the operations api.

Furthermore, is there a way to limit the amount of requests returned by a query? What is the aerospike way to retrieve records in batches without preforming a full scan? I have the taste of an idea that involves ending the stream inside a UDF once X number of records have passed through it, is this the right direction?

In short, looking for a BatchOperation that will allow a ‘BatchGet’ and ‘BatchDelete’ and a way to limit the amount of results from a query.

  1. BatchGet is only to perform fetch operations.
  2. You can perform multiple operations via QueryExecute adding Policy.FilterExpressions.
  3. We are going to release a feature on the client soon that allow you to perform limited scans. At the moment, you can query and then close the recordset when you have enough records.

Hey, im not sure how to chain commands through the FilterExpression. If I wanted to change the value of a bin for each record how would I do that?

If you could mention your exact use case, I’d be able to to help you more specifically. If your use-case involves complicated operations or getting the results back right after change, the only way to do it would be to use a Stream UDF (with its performance implications) If it can be done using simple Operations and does not involve fetching back the results, then you can use ExecuteQuery via FilterExpressions. You can see examples here:

Don’t hesitate to ask in case you have further questions.

© 2021 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.