Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTL command returns true instead of time #742

Closed
medric opened this issue Apr 19, 2015 · 2 comments
Closed

TTL command returns true instead of time #742

medric opened this issue Apr 19, 2015 · 2 comments
Labels

Comments

@medric
Copy link

medric commented Apr 19, 2015

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.

@medric medric closed this as completed Apr 19, 2015
@dirkbonhomme
Copy link

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)
});

@medric
Copy link
Author

medric commented Apr 20, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants