expire
Last updated
Was this helpful?
Last updated
Was this helpful?
key
, seconds
, callback
) 為key
對應資料設定seconds
秒的效期(Expire Time),時間超過效期資料自動變空值。
Redis 7.0版本起 起支援以下參數:
NX
-- Set expiry only when the key has no expiry
XX
-- Set expiry only when the key has an existing expiry
GT
-- Set expiry only when the new expiry is greater than current one
LT
-- Set expiry only when the new expiry is less than current one
A non-volatile key is treated as an infinite TTL for the purpose of GT
and LT
. The GT
, LT
and NX
options are mutually exclusive.