eval_ro.3valkey - Man Page

Executes a read-only server-side Lua script.

Synopsis

EVAL_RO script numkeys key [key...] arg [arg...]

Description

This is a read-only variant of the EVAL command that cannot execute commands that modify data.

For more information about when to use this command vs EVAL, please refer to valkey-programmability(7) Read-only scripts.

For more information about EVAL scripts please refer to valkey-eval-intro(7) Introduction to Eval Scripts.

Reply

The return value depends on the script that was executed.

Complexity

Depends on the script that is executed.

Acl Categories

@scripting @slow

History

Examples

> SET mykey "Hello"
OK

> EVAL_RO "return server.call('GET', KEYS[1])" 1 mykey
"Hello"

> EVAL_RO "return server.call('DEL', KEYS[1])" 1 mykey
(error) ERR Error running script (call to b0d697da25b13e49157b2c214a4033546aba2104): @user_script:1: @user_script: 1: Write commands are not allowed from read-only scripts.

See Also

eval(3valkey), evalsha(3valkey), evalsha_ro(3valkey), fcall(3valkey), fcall_ro(3valkey), function(3valkey), function-delete(3valkey), function-dump(3valkey), function-flush(3valkey), function-help(3valkey), function-kill(3valkey), function-list(3valkey), function-load(3valkey), function-restore(3valkey), function-stats(3valkey), script(3valkey), script-debug(3valkey), script-exists(3valkey), script-flush(3valkey), script-help(3valkey), script-kill(3valkey), script-load(3valkey), script-show(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual