I wanted to get a record from the aerospike. So, I was using the Client.Get method.
However, whenever I do a Get I also want to refresh the TTL of the record. So, usually we use a WritePolicy which allows us to set a ttl. But then the Get method accepts only a BasePolicy
Is the following way correct or is there a better way of doing this?
client.Get(nil, key, bin)
client.Touch(myWritePolicy, key)
Do it within an operate() command, you can touch() as well as get() in the same lock, one network trip. Note, if your record is stored on disk, updating TTL, however you do it, will entail a new write of the record to a different location on the disk because TTL info is stored in the record metadata.