Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Evalsha Command

Redis Evalsha Command

Redis Scripting

The Redis Evalsha command executes a script cached on the server based on the given sha1 checksum.

The operation of caching a script to the server can be done via the SCRIPT LOAD command.

Other aspects of this command, such as how parameters are passed, are the same as the EVAL command.

Syntax

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



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

Parameter Description:

Available Version

= 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