EVAL

Executes a supplied Lua script with declared keys.

Lua & functions · Example verified

Syntax covered here

EVAL script numkeys key

The example reads one declared key through redis.call; the architecture rejects access to undeclared keys.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> SET sample value
"OK"
# connection: default
> EVAL "return redis.call('GET', KEYS[1])" 1 sample
"value"