Redis Advanced icon

Redis Advanced

Get, send and update data in Redis with enhanced operations

TTL

AI-generated

Summary

Get the remaining time to live (TTL) in seconds for a specified Redis key.

Inputs

  • Key (required) — The name of the key to check the TTL for.

Output shape

a single JSON object containing the key name and its TTL value in seconds

The TTL value is the number of seconds until the key expires. A TTL of -1 indicates the key exists but has no associated expiration, and -2 indicates the key does not exist.

Discussion