PEXPIRE
Note
Official reference: PEXPIRE.
Set a key lifetime in milliseconds.
Syntax
PEXPIRE key milliseconds [NX | XX | GT | LT]
NX sets only absent expirations; XX changes existing expirations; GT/LT only extend/shorten them. A lifetime of zero or less deletes the key immediately.
Results
| Return | Rows | Content |
|---|---|---|
| Update count | -- | 1 if timeout was set; 0 otherwise. |
Example
SET demo:message hello
PEXPIRE demo:message 60000