psetex
PSETEX
The data is deleted after the specified time: in milliseconds
The data is deleted after the specified milliseconds.
Use this when you need a finer-grained expire time.
Example
| Command> | psetex key 10000 value
|
| Result> | OK
|
| Command> | pttl key
|
| Result> | 5687 remaining time in milliseconds
|
| Command> | get key
|
| Result> | value
|
| Command> | get key
|
| Result> | (nil) the data was deleted after 10000 milliseconds
|
|
PTTL reports the remaining time in milliseconds.
|
Syntax
PSETEX key milliseconds value
- Available since version 2.6.0.
- Time complexity is O(1).