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