Skip to main content

HPTTL

Note

Official reference: HPTTL.

Read remaining field lifetimes in milliseconds.

Syntax

HPTTL key FIELDS numfields field [field ...]

Requires Redis 7.4+. numfields must match the number of following fields. Each field produces a RESULT row in argument order.

-1 means no expiration; -2 means the field does not exist.

Results

ReturnRowsContent
ResultSetmultipleRESULT field, LONG type

Example

HSET demo:user name mali
HPEXPIRE demo:user 60000 FIELDS 1 name
HPTTL demo:user FIELDS 1 name