dump
DUMP
Dump the data
Simple usage is dump key.
Returns the value in a Redis-specific format. You can restore it to the DB with the RESTORE command.
Dump data does not include expire time. You can set expire time when using RESTORE.
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
DUMP key
- Available since version 2.6.0.
- Time complexity is O(1).