PEXPIRE key milliseconds
相关命令
- DEL
- DUMP
- EXISTS
- EXPIRE
- EXPIREAT
- KEYS
- MIGRATE
- MOVE
- OBJECT
- PERSIST
- PEXPIRE
- PEXPIREAT
- PTTL
- RANDOMKEY
- RENAME
- RENAMENX
- RESTORE
- SCAN
- SORT
- TTL
- TYPE
Available since 2.6.0.
时间复杂度: O(1)
This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.
Integer reply, specifically:
1
if the timeout was set.0
ifkey
does not exist or the timeout could not be set.
例子
redis> SET mykey "Hello"
- OK
redis> PEXPIRE mykey 1500
- (integer) 1
redis> TTL mykey
- (integer) 1
redis> PTTL mykey
- (integer) 1499
This website is open source software developed by Citrusbyte.
The Redis logo was designed by Carlos Prioglio. See more credits.