Hi,
redis.ttl(key)
returns true, while it should return the time to expiration according to the redis documentation.
Is there a way to get the remaining time ?
Thanks.
All Redis commands in Node.js are asynchronous which means you'll have to catch the result in a callback:
redis.ttl(key, function(error, ttl){
console.log('TTL is', ttl)
});
Hi,
Yes, sorry, I just figured it out a few minutes after posting this issue. That is why I closed it immediately.
Thanks for your answer anyway.
Most helpful comment
All Redis commands in Node.js are asynchronous which means you'll have to catch the result in a callback: