Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

FUNCTION

Last updated
FUNCTION LOAD [REPLACE] function-code
FUNCTION DELETE library-name
FUNCTION LIST [LIBRARYNAME library-name-pattern] [WITHCODE]
FUNCTION STATS
FUNCTION DUMP
FUNCTION RESTORE serialized-value [FLUSH | APPEND | REPLACE]
FUNCTION FLUSH [ASYNC | SYNC]
FUNCTION KILL
FUNCTION HELP
Group
Scripting and functions
Arity
-2 (at least 2 words, counting the command name)
Flags
slow
HotKV Cloud
All plans
On-Premise
no license needed

FUNCTION is a container for subcommands that manage function libraries, whose functions you call with FCALL and FCALL_RO. Libraries are part of the dataset: they are persisted and replicated like keys. LOAD, DELETE, RESTORE and FLUSH change them and are refused on a read-only replica.

Subcommand What it does
FUNCTION LOAD Load a library, or replace one
FUNCTION DELETE Delete a library and its functions
FUNCTION LIST List libraries and their functions
FUNCTION STATS Count libraries and functions
FUNCTION DUMP Serialize all libraries
FUNCTION RESTORE Load libraries from a FUNCTION DUMP payload
FUNCTION FLUSH Delete all libraries
FUNCTION KILL Stop a running function that has not written yet
FUNCTION HELP A short description of each subcommand

An unknown subcommand replies with ERR unknown subcommand '<name>'. Try FUNCTION HELP.

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> FCALL echo 0 "hi"
"hi"
127.0.0.1:6379> FUNCTION DELETE util
OK

The same subcommands as Redis 7 and Valkey 8. The payload of FUNCTION DUMP is HotKV’s own and cannot be exchanged with Redis or Valkey.

FCALL, SCRIPT, EVAL