I want to use a record as a counter that expires after 20 seconds after the first increment.
Currently this is my approach:
- Increment the counter once en retrieve the new value
- If the new value is 1, I set the expiration to 20 seconds
This works correctly until i modify the record, for example by incrementing the counter. After more increments, the expiration that was set in step 2. is cleared, and the ttl from the namespace’s default expiration is used.
Is it possible to update a record while keeping the original expiration?