Skip to main content
Documentation
API Reference
Search
⌘K
Ask AI
⌘I
Discord
Blog
Twitter
Console
Redis
/
/
SDKs
/
Typescript
/
Commands
/
Generic
TTL
Return the expiration in seconds of a key.
1 min read
Copy as Markdown
Arguments
#
key
string
required
#
The key
Response
#
TOUCH
TYPE
Example
const
seconds
=
await
redis.
ttl
(key);