Mttl
Bun

method

RedisClient.ttl

key: KeyLike
): Promise<number>;

Get the time to live for a key in seconds

@param key

The key to get the TTL for

@returns

Promise that resolves with the TTL, -1 if no expiry, or -2 if key doesn't exist

Referenced types

type KeyLike = string | ArrayBufferView | Blob