How to get records whose ttl is -1



how to fetch records whose ttl is -1 , please provide solution.



You would need to perform a scan. If you have server v 3.12+ this can be accomplished using predicate filters otherwise you would need to get the ttl of every record that is passed back to you, and parse it in your client. Another alternative, is to use UDF.

How many records do you need to scan for?


I have 3.13 server, and 500K data


Okay, but what do you plan to do? Do you want to remove the records with the 0 void time? Do you want to reset their TTL to a specific amount of time?


Yes i want to reset their TTL to a specific amount of time.


Code sample given in your same question in stackoverflow.


@rbotzer are you sure th “dirty bin” is required? I’m doing a udf scan but I don’t think bin Val change was required… now I’m worried haha


The aerospike:update function skips the update if a bin assignment didn’t happen. I have an open JIRA for considering a metadata assignment the same way.

I’m quite sure it’s still an issue.