GETSET
Note
Official reference: GETSET.
Replace a string and return its previous value.
Syntax
GETSET key value
A missing key returns one row with a null VALUE.
New code can use SET ... GET, with expiration options when needed.
Results
| Return | Rows | Content |
|---|---|---|
| ResultSet | 1 | VALUE field, STRING type |
Example
SET demo:message hello
GETSET demo:message world