restore
RESTORE
Restore data
Simple usage: RESTORE key 0 "serialized value".
The "serialized value" is the value obtained with DUMP.
After the key you can specify an expire time in milliseconds. 0 means no expire time.
The REPLACE option overwrites the key if it already exists.
Example
| Command> | set key a |
| Result> | OK |
| Command> | dump key |
| Result> | "\x00\x01a\x06\x00)\x13\x87\x1bzcA'" |
| Command> | del key |
| Result> | 1 |
| Command> | restore key 0 "\x00\x01a\x06\x00)\x13\x87\x1bzcA'" |
| Result> | OK |
| Command> | get key |
| Result> | a |
Syntax
RESTORE key ttl serialized-value [REPLACE]
- Available since version 2.6.0.
- Time complexity is O(1).
- From 6.0, event notification is emitted -> 'restore'