Easy Tutorial
❮ Lists Linsert Sets Sunionstore ❯

Redis Evalsha Command

Redis Scripting

The Redis Evalsha command executes a script cached on the server by its sha1 checksum.

Caching a script on the server can be done using the SCRIPT LOAD command.

This command is identical to the EVAL command in other aspects, such as how parameters are passed.

Syntax

The basic syntax for the redis Evalsha command is as follows:

redis 127.0.0.1:6379> EVALSHA sha1 numkeys key [key ...] arg [arg ...]

Parameter explanations:

Available Versions

= 2.6.0

Example

redis 127.0.0.1:6379> SCRIPT LOAD "return 'hello moto'"
"232fd51614574cf0867b83d384a5e898cfd24e5a"

redis 127.0.0.1:6379> EVALSHA "232fd51614574cf0867b83d384a5e898cfd24e5a" 0
"hello moto"

Redis Scripting

❮ Lists Linsert Sets Sunionstore ❯