Syntax
Parameters
The name of the key to inspect.
Return value
| Return value | Meaning |
|---|---|
N (positive integer) | Key exists and will expire in N seconds |
-1 | Key exists but has no expiration |
-2 | Key does not exist or has already expired |
Examples
Notes
TTL implements passive expiry. If the key has expired at the time of the call, it is deleted from the hash table and -2 is returned.Use
SET with the EX option to assign or update a key’s TTL. There is no standalone EXPIRE command in RadishDB.