Return the expiration in seconds of a key.
const seconds = await redis.ttl(key);
The key
The number of seconds until this expires, negative if the key does not exist or does not have an expiration set.
Was this page helpful?