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

Redis Eval Command

Redis Eval Command

Redis Scripting

The Redis Eval command uses the Lua interpreter to execute scripts.

Syntax

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



redis 127.0.0.1:6379> EVAL script numkeys key [key ...] arg [arg ...] 

Parameter Description:

Available Version

= 2.6.0

Example



redis 127.0.0.1:6379> eval "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 key1 key2 first second

1) "key1"

2) "key2"

3) "first"

4) "second"

Redis Scripting