tencent cloud

scripting and functions Group
Last updated:2025-12-25 17:47:41
scripting and functions Group
Last updated: 2025-12-25 17:47:41
Redis versions 2.8 (Standard Architecture), 4.0, 5.0, 6.2, 7.0, and ValKey 8.0 (both Standard Architecture and Cluster Architecture) support the eval, evalsha, script exists, script flush, script load, and script kill commands, but do not support the script debug command. The eval, evalsha, and script exists commands are not supported in cross-slot scenarios for the Cluster Architecture. Version 7.0 introduces function-related commands, as shown in the following table.
Command Family
Command
New Description
function (added in Redis 7.0)
FUNCTION DELETE library-name
Added the function feature.
Delete a lib and its functions.
FUNCTION DUMP
Export all functions.
FUNCTION FLUSH [ASYNC | SYNC]

Delete all libs and their functions.
FUNCTION KILL

Kill the currently executing function.
FUNCTION LIST [LIBRARYNAME library-name-pattern] [WITHCODE]
Return information about the lib and functions.
FUNCTION LOAD [REPLACE] function-code
Load/Replace functions.
FUNCTION RESTORE serialized-value [FLUSH | APPEND | REPLACE]

is used to restore snapshots previously saved using the SAVE or BGSAVE commands.
FLUSH: Before a snapshot is restored, all data in the current database will be cleared.
APPEND: Before a snapshot is restored, the data in the current database will be appended to the snapshot.
REPLACE: Before a snapshot is restored, the data in the current database will be completely replaced by the data in the snapshot.
FUNCTION STATS
Return the status of the currently executing function.
FCALL function numkeys [key [key ...]] [arg [arg ...]]
Invoke a function.
FCALL_RO function numkeys [key [key ...]] [arg [arg ...]]
FCALL Readonly edition.
Scripting Family
EVAL_RO script numkeys [key [key ...]] [arg [arg ...]]
New command to run lua scripts in read-only replicas.
EVALSHA_RO sha1 numkeys [key [key ...]] [arg [arg ...]]
New command to run lua scripts in read-only replicas.
Specific support details for each version, see the table below. ✓ indicates supported, x indicates not supported, - indicates that the command does not involve cross-slot access scenarios.
Command
Redis 7.0/ValKey 8.0 Standard Architecture
Redis 7.0/ValKey 8.0 Cluster Architecture
Redis 6.2 Standard Architecture
Redis 6.2 Cluster Architecture
Redis 5.0 Standard Architecture
Redis 5.0 Cluster Architecture
Redis 4.0 Standard Architecture
Redis 4.0 Cluster Architecture
Redis 2.8 Standard Architecture
Cluster Architecture Cross-Slot Support
eval
x
eval_ro
x
x
x
x
x
x
x
-
evalsha
x
evalsha_ro
x
x
x
x
x
x
x
-
script debug
x
x
x
x
x
x
x
x
x
-
script exists
x
script flush
-
script load
-
script kill
-
function delete
x
x
x
x
x
x
x
-
function kill
x
x
x
x
x
x
x
-
function dump
x
x
x
x
x
x
x
-
function flush
x
x
x
x
x
x
x
-
function list
x
x
x
x
x
x
x
-
function load
x
x
x
x
x
x
x
-
function restore
x
x
x
x
x
x
x
-
function status
x
x
x
x
x
x
x
-
fcall
x
x
x
x
x
x
x
-
fcall_ro
x
x
x
x
x
x
x
-
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback