EVALSHA
EVALSHA sha1 numkeys [key [key ...]] [arg [arg ...]]
evalsha(
sha: str, // SHA1 digest of the script
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 - MASTERDOWN:
MasterDownError - MISCONF:
ResponseError - NOPERM:
NoPermissionError - NOREPLICAS:
ResponseError - NOSCRIPT:
NoScriptError - OOM:
OutOfMemoryError - READONLY:
ReadOnlyError
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalSha(
sha1: RedisArgument, // SHA1 digest of the script
options: EvalOptions // Script execution options including keys and arguments
) → Promise<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 - MASTERDOWN:
SimpleError(test witherr.message.startsWith('MASTERDOWN')) - MISCONF:
SimpleError(test witherr.message.startsWith('MISCONF')) - NOPERM:
SimpleError(test witherr.message.startsWith('NOPERM')) - NOREPLICAS:
SimpleError(test witherr.message.startsWith('NOREPLICAS')) - NOSCRIPT:
SimpleError(test witherr.message.startsWith('NOSCRIPT')) - 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.
evalsha(
sha1: String, // SHA1 digest of the script
keyCount: int, // Number of keys in the script
params: String... // Keys and arguments for the script
) → Object // Script execution result
evalsha(
sha1: String, // SHA1 digest of the script
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 - MASTERDOWN:
JedisDataException - MISCONF:
JedisDataException - NOPERM:
JedisAccessControlException - NOREPLICAS:
JedisDataException - NOSCRIPT:
JedisNoScriptException - OOM:
JedisDataException - READONLY:
JedisDataException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalsha(
digest: String, // SHA1 of the script
type: ScriptOutputType, // Output type
keys: K... // The keys
) → <T> T // Script result
evalsha(
digest: String, // SHA1 of the 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 - MASTERDOWN:
RedisCommandExecutionException - MISCONF:
RedisCommandExecutionException - NOPERM:
RedisCommandExecutionException - NOREPLICAS:
RedisCommandExecutionException - NOSCRIPT:
RedisNoScriptException - OOM:
RedisCommandExecutionException - READONLY:
RedisReadOnlyException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalsha(
digest: String, // SHA1 of the script
type: ScriptOutputType, // The type
keys: K... // The keys
) → <T> RedisFuture<T> // Script result
evalsha(
digest: String, // SHA1 of the 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 - MASTERDOWN:
RedisCommandExecutionException - MISCONF:
RedisCommandExecutionException - NOPERM:
RedisCommandExecutionException - NOREPLICAS:
RedisCommandExecutionException - NOSCRIPT:
RedisNoScriptException - OOM:
RedisCommandExecutionException - READONLY:
RedisReadOnlyException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalsha(
digest: String, // SHA1 of the script
type: ScriptOutputType, // The type
keys: K... // The keys
) → <T> Flux<T> // Script result
evalsha(
digest: String, // SHA1 of the 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 - MASTERDOWN:
RedisCommandExecutionException - MISCONF:
RedisCommandExecutionException - NOPERM:
RedisCommandExecutionException - NOREPLICAS:
RedisCommandExecutionException - NOSCRIPT:
RedisNoScriptException - OOM:
RedisCommandExecutionException - READONLY:
RedisReadOnlyException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
EvalSha(
ctx: context.Context, // Context for the operation
sha1: string, // SHA1 digest of the script
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 - MASTERDOWN:
redis.Error(test withredis.IsMasterDownError(err)) - MISCONF:
redis.Error(test withredis.HasErrorPrefix(err, "MISCONF")) - NOPERM:
redis.Error(test withredis.IsPermissionError(err)) - NOREPLICAS:
redis.Error(test withredis.IsNoReplicasError(err)) - NOSCRIPT:
redis.Error(test witherrors.Is(err, redis.ErrNoScript)) - 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.
ScriptEvaluate(
hash: byte[], // SHA1 hash of the script
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 - MASTERDOWN:
RedisServerException - MISCONF:
RedisServerException - NOPERM:
RedisConnectionException - NOREPLICAS:
RedisServerException - NOSCRIPT:
RedisServerException - OOM:
RedisServerException - READONLY:
RedisConnectionException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
ScriptEvaluateAsync(
hash: byte[], // SHA1 hash of the script
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 - MASTERDOWN:
RedisServerException - MISCONF:
RedisServerException - NOPERM:
RedisConnectionException - NOREPLICAS:
RedisServerException - NOSCRIPT:
RedisServerException - OOM:
RedisServerException - READONLY:
RedisConnectionException
See Redis error messages for what each error means. Other errors, such as connection errors, aren't listed.
evalsha(
$script: string, // SHA1 digest of the script
$numkeys: int, // Number of keys in the script
$keyOrArg: string... // Keys and 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 - MASTERDOWN:
Predis\Response\ServerException(test with$e->getErrorType() === 'MASTERDOWN') - 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') - NOSCRIPT:
Predis\Response\ServerException(test with$e->getErrorType() === 'NOSCRIPT') - 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.
No method signature available for this client.
- Available since:
- Redis Open Source 2.6.0
- Time complexity:
- Depends on the script that is executed.
- ACL categories:
-
@slow,@scripting, - Compatibility:
- Redis Software and Redis Cloud compatibility
This command's behavior varies in clustered Redis environments. See the multi-key operations page for more information.
Evaluate a script from the server's cache by its SHA1 digest.
The server caches scripts by using the SCRIPT LOAD command.
The command is otherwise identical to EVAL.
Please refer to the Redis Programmability and Introduction to Eval Scripts for more information about Lua scripts.
Required arguments
sha1
The SHA1 digest of a script previously cached with SCRIPT LOAD or EVAL.
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.
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |