# 语法
EVAL script numkeys key [key ...] arg [arg ...]

# 示例
eval "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 name age king 18

redis lua 脚本_redis


# 没有参数  set foo bar
eval "return redis.call('set','foo','bar')" 0

# 1个参数 set foo bar
eval "return redis.call('set',KEYS[1],'bar')" 1 foo

# get king
eval "return redis.call('get',KEYS[1])" 1 king


eval "return 10" 0