Arguments
str
required
The read-only lua script to run.
List[str]
required
All of the keys accessed in the script
unknown[]
required
All of the arguments you passed to the script
Response
The result of the script.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
script = """
local value = redis.call("GET", KEYS[1])
return value
"""
redis.set("mykey", "Hello")
assert redis.eval_ro(script, keys=["mykey"]) == "Hello"
assert redis.eval_ro("return ARGV[1]", args=["Hello"]) == "Hello"
Evaluate a read-only Lua script server side.
script = """
local value = redis.call("GET", KEYS[1])
return value
"""
redis.set("mykey", "Hello")
assert redis.eval_ro(script, keys=["mykey"]) == "Hello"
assert redis.eval_ro("return ARGV[1]", args=["Hello"]) == "Hello"
Was this page helpful?