await redis.hset("my-key", "my-field", "my-value"); await redis.hpexpire("my-key", "my-field", 1000); const ttl = await redis.hpttl("my-key", "my-field"); console.log(ttl); // e.g., [950]
Retrieves the remaining time-to-live (TTL) for field(s) in a hash in milliseconds.
-2
-1
Was this page helpful?