HTTL

Syntax
HTTL key FIELDS numfields field [field ...]
Available since:
7.4.0
Time complexity:
O(N) where N is the number of specified fields
ACL categories:
@read, @hash, @fast,

返回具有设置过期时间的哈希键字段的剩余TTL(生存时间)。 这种内省能力允许您检查给定哈希字段将继续作为哈希键的一部分的秒数。

另请参阅HPTTL命令,它以毫秒分辨率返回相同的信息。

示例

redis> HTTL no-key FIELDS 3 field1 field2 field3
(nil)
redis> HSET mykey field1 "hello" field2 "world"
(integer) 2
redis> HEXPIRE mykey 300 FIELDS 2 field1 field3
1) (integer) 1
2) (integer) -2
redis> HTTL mykey FIELDS 3 field1 field2 field3
1) (integer) 283
2) (integer) -1
3) (integer) -2

RESP2/RESP3 回复


RATE THIS PAGE
Back to top ↑