Scripts
EVAL
Evaluate a Lua script server side.
Arguments
scriptbodystrrequired
The lua script to run.
keysbodyList[str]required
All of the keys accessed in the script
argsbodyunknown[]required
All of the arguments you passed to the script
Response
Anyrequired
The result of the script.
Example
script = """local value = redis.call("GET", KEYS[1])return value"""redis.set("mykey", "Hello")assert redis.eval(script, keys=["mykey"]) == "Hello"Accepting arguments
assert redis.eval("return ARGV[1]", args=["Hello"]) == "Hello"