Do not throw on Key not found

Hi,

I’m currently using the Aerospike C# client and when i try to call Put on a non existing Record, the client is throwing an Exception.

Is there a way to avoid to throw an Exception in a write operation (either Put or Operate) when the record doesn’t exit and just ignore it ?

The only solution i found for now is to use a UDF, but it’s overengineered imho.

Regards,

By put on an existing record are you referring to add elements to a map or list? I see some example on this tutorial: Aerospike Interactive Tutorial: Advanced Collection Data Types | Developer .

If you are referring to updating an existing record (like adding a bin) there are also different policies. Here is a page with some details: Update a Record | Developer.

I’d like to update a bin with an UPDATE_ONLY policy as I don’t want to create the record if not already present.

If the record doesn’t exist, an exception is thrown by the client, but catching the exception would be too costly in my case (high load environment).

Other than using a UDF, the exception is unavoidable if UPDATE_ONLY is used and the record does not exist.

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.