Search…
⌘K
Ask AI
⌘I
Discord
Blog
Twitter
Console
Overview
Redis
Vector
QStash
Workflow
Search
Box
Realtime
Developer API
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);