NodeJS Expiration Policy

Hello there,

Is there any way in nodejs to update a record and not changing its TTL ?

If that’s not possible, is there any way to set expiration date for a record? So when first I read a record I save its TTL and then when updating it, I set the same TTL as it had before.


You can use UDFs and, as you said, save the first TTL in a bin. Everytime you want to update a record, use an UDF to:

  1. Updates the bin(s) you need

  2. Reset the TTL using the original TTL you stored using record.set_ttl(rec, ttl)

edited because incomplete answer of mine

Hi ronny, thanks for your quick response.

I believe you said that because there is no way to do the same with nodejs client, is that right?


1 Like
© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.