RESTORE
Since 1.1.0Keys
Syntax
RESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]Creates key from a DUMP payload. ttl is in milliseconds, 0 for no expiry.
Options
| Option | Effect |
|---|---|
REPLACE | Replace key if it exists. |
ABSTTL | ttl is a Unix time in milliseconds, not a duration. |
IDLETIME seconds, FREQ frequency | Accepted for compatibility with Redis; only one of the two can be given. |
Reply
OK.BUSYKEY Target key name already exists.ifkeyexists andREPLACEwas not given.ERR DUMP payload version or checksum are wrongif the payload is damaged, or not KiviDB's.
Examples
> SET src hello
OK
> DUMP src
"\x01\x05\x00\x00\x00hello..."
> RESTORE copy 0 "\x01\x05\x00\x00\x00hello..."
OK
> GET copy
"hello"
> RESTORE copy 5000 "\x01\x05..." REPLACE
OK
> PTTL copy
(integer) 5000