FUNCTION DUMP
FUNCTION DUMP
- Group
- Scripting and functions
- Complexity
- O(N) where N is the number of libraries
- Arity
- 2 (exactly, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
FUNCTION DUMP returns all loaded libraries as one binary payload. Pass it to
FUNCTION RESTORE, on this server or another
HotKV server, to load the same libraries there. The payload holds the source
code of each library, so restoring it compiles them again. With no libraries
loaded, the payload is an empty string.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Bulk string: the payload | Bulk string |
Examples
Section titled “Examples”127.0.0.1:6379> FUNCTION LOAD "#!lua name=util\nredis.register_function('echo', function(keys, args) return args[1] end)""util"127.0.0.1:6379> FUNCTION DUMP"#!lua name=util\nredis.register_function('echo', function(keys, args) return args[1] end)\x00"Compatibility
Section titled “Compatibility”The payload format is HotKV’s own. A payload from Redis or Valkey cannot be
restored on HotKV and the other way round; to move libraries between them, load
the source code with FUNCTION LOAD (you can get it
from FUNCTION LIST WITHCODE).
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.