EVAL_RO
EVAL_RO script numkeys [key [key ...]] [arg [arg ...]]
eval_ro(
script: str, // Lua script to execute
numkeys: int, // Number of keys in the script
*keys_and_args: Union[KeyT, EncodableT] // Keys and arguments for the script
) → Union[Awaitable[str], str] // Script execution result
Possible errors
- BUSY:
ResponseError - CLUSTERDOWN:
ClusterDownError - ERR wrong number of arguments:
ResponseError - MISCONF:
ResponseError - NOPERM:
NoPermissionError - NOREPLICAS:
ResponseError - OOM:
OutOfMemoryError - READONLY:
ReadOnlyError
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalRo(
script: RedisArgument, // Lua script to execute
options: EvalOptions // Script execution options including keys and arguments
) → ReplyUnion // Script execution result
Possible errors
- BUSY:
SimpleError(test witherr.message.startsWith('BUSY')) - CLUSTERDOWN:
SimpleError(test witherr.message.startsWith('CLUSTERDOWN')) - ERR wrong number of arguments:
SimpleError - MISCONF:
SimpleError(test witherr.message.startsWith('MISCONF')) - NOPERM:
SimpleError(test witherr.message.startsWith('NOPERM')) - NOREPLICAS:
SimpleError(test witherr.message.startsWith('NOREPLICAS')) - OOM:
SimpleError(test witherr.message.startsWith('OOM')) - READONLY:
SimpleError(test witherr.message.startsWith('READONLY'))
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
No method signature available for this client.
evalReadonly(
script: String, // Lua script to execute
keys: List<String>, // Keys for the script
args: List<String> // Arguments for the script
) → Object // Script execution result
Possible errors
- BUSY:
JedisBusyException - CLUSTERDOWN:
JedisClusterException - ERR wrong number of arguments:
JedisDataException - MISCONF:
JedisDataException - NOPERM:
JedisAccessControlException - NOREPLICAS:
JedisDataException - OOM:
JedisDataException - READONLY:
JedisDataException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalReadOnly(
script: String, // Lua 5.1 script
type: ScriptOutputType, // Output type
keys: K[], // The keys
values: V... // The values
) → <T> T // Script result
evalReadOnly(
script: byte[], // Lua 5.1 script
type: ScriptOutputType, // Output type
keys: K[], // The keys
values: V... // The values
) → <T> T // Script result
Possible errors
- BUSY:
RedisBusyException - CLUSTERDOWN:
RedisCommandExecutionException - ERR wrong number of arguments:
RedisCommandExecutionException - MISCONF:
RedisCommandExecutionException - NOPERM:
RedisCommandExecutionException - NOREPLICAS:
RedisCommandExecutionException - OOM:
RedisCommandExecutionException - READONLY:
RedisReadOnlyException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalReadOnly(
script: String, // Lua 5.1 script
type: ScriptOutputType, // The type
keys: K[], // The keys
values: V... // The values
) → <T> RedisFuture<T> // Script result
evalReadOnly(
script: byte[], // Lua 5.1 script
type: ScriptOutputType, // The type
keys: K[], // The keys
values: V... // The values
) → <T> RedisFuture<T> // Script result
Possible errors
- BUSY:
RedisBusyException - CLUSTERDOWN:
RedisCommandExecutionException - ERR wrong number of arguments:
RedisCommandExecutionException - MISCONF:
RedisCommandExecutionException - NOPERM:
RedisCommandExecutionException - NOREPLICAS:
RedisCommandExecutionException - OOM:
RedisCommandExecutionException - READONLY:
RedisReadOnlyException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalReadOnly(
script: String, // Lua 5.1 script
type: ScriptOutputType, // The type
keys: K[], // The keys
values: V... // The values
) → <T> Flux<T> // Script result
evalReadOnly(
script: byte[], // Lua 5.1 script
type: ScriptOutputType, // The type
keys: K[], // The keys
values: V... // The values
) → <T> Flux<T> // Script result
Possible errors
- BUSY:
RedisBusyException - CLUSTERDOWN:
RedisCommandExecutionException - ERR wrong number of arguments:
RedisCommandExecutionException - MISCONF:
RedisCommandExecutionException - NOPERM:
RedisCommandExecutionException - NOREPLICAS:
RedisCommandExecutionException - OOM:
RedisCommandExecutionException - READONLY:
RedisReadOnlyException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
EvalRO(
ctx: context.Context, // Context for the operation
script: string, // Lua script to execute
keys: []string, // Keys for the script
args: ...interface{} // Arguments for the script
) → *Cmd // Script execution result
Possible errors
- BUSY:
redis.Error(test withredis.HasErrorPrefix(err, "BUSY")) - CLUSTERDOWN:
redis.Error(test withredis.IsClusterDownError(err)) - ERR wrong number of arguments:
redis.Error - MISCONF:
redis.Error(test withredis.HasErrorPrefix(err, "MISCONF")) - NOPERM:
redis.Error(test withredis.IsPermissionError(err)) - NOREPLICAS:
redis.Error(test withredis.IsNoReplicasError(err)) - OOM:
redis.Error(test withredis.IsOOMError(err)) - READONLY:
redis.Error(test withredis.IsReadOnlyError(err))
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
ScriptEvaluateReadOnly(
script: string, // Lua script to execute
keys: RedisKey[]?, // Keys for the script
values: RedisValue[]?, // Arguments for the script
flags: CommandFlags // Command flags
) → RedisResult // Script execution result
Possible errors
- BUSY:
RedisConnectionException - CLUSTERDOWN:
RedisServerException - ERR wrong number of arguments:
RedisServerException - MISCONF:
RedisServerException - NOPERM:
RedisConnectionException - NOREPLICAS:
RedisServerException - OOM:
RedisServerException - READONLY:
RedisConnectionException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
ScriptEvaluateReadOnlyAsync(
script: string, // Lua script to execute
keys: RedisKey[]?, // Keys for the script
values: RedisValue[]?, // Arguments for the script
flags: CommandFlags // Command flags
) → Task<RedisResult> // Script execution result
Possible errors
- BUSY:
RedisConnectionException - CLUSTERDOWN:
RedisServerException - ERR wrong number of arguments:
RedisServerException - MISCONF:
RedisServerException - NOPERM:
RedisConnectionException - NOREPLICAS:
RedisServerException - OOM:
RedisServerException - READONLY:
RedisConnectionException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
eval_ro(
$script: string, // Lua script to execute
$keys: array, // Keys for the script
$argument: ... // Arguments for the script
) → mixed // Script execution result
Possible errors
- BUSY:
Predis\Response\ServerException(test with$e->getErrorType() === 'BUSY') - CLUSTERDOWN:
Predis\Response\ServerException(test with$e->getErrorType() === 'CLUSTERDOWN') - ERR wrong number of arguments:
Predis\Response\ServerException - MISCONF:
Predis\Response\ServerException(test with$e->getErrorType() === 'MISCONF') - NOPERM:
Predis\Response\ServerException(test with$e->getErrorType() === 'NOPERM') - NOREPLICAS:
Predis\Response\ServerException(test with$e->getErrorType() === 'NOREPLICAS') - OOM:
Predis\Response\ServerException(test with$e->getErrorType() === 'OOM') - READONLY:
Predis\Response\ServerException(test with$e->getErrorType() === 'READONLY')
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
No method signature available for this client.
redis-rs has no dedicated method for this command. Send it with redis::cmd.
redis-rs has no dedicated method for this command. Send it with redis::cmd.
- Available since:
- Redis Open Source 7.0.0
- Time complexity:
- Depends on the script that is executed.
- ACL categories:
-
@slow,@scripting, - Compatibility:
- Redis Software and Redis Cloud compatibility
Runs a read-only Lua script. Unlike EVAL, this command can’t run commands that modify data.
For more information about when to use this command versus EVAL, please refer to Read-only scripts.
For more information about EVAL scripts please refer to Introduction to Eval Scripts.
Required arguments
script
The Lua script to evaluate. It must not modify data.
numkeys
The number of key names that follow. Arguments after the keys are passed as regular arguments.
Optional arguments
key [key ...]
The key names the script accesses, provided to it via the Lua KEYS global variable. There must be exactly numkeys of them.
arg [arg ...]
Additional arguments provided to the script via the Lua ARGV variable.
Examples
> SET mykey "Hello"
OK
> EVAL_RO "return redis.call('GET', KEYS[1])" 1 mykey
"Hello"
> EVAL_RO "return redis.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.
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |