Scripts
EVAL_RO
Evaluate a read-only Lua script server side.
Arguments
scriptbodystrrequired
The read-only 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_ro(script, keys=["mykey"]) == "Hello"Accepting arguments
assert redis.eval_ro("return ARGV[1]", args=["Hello"]) == "Hello"