redis-cli EVAL "return redis.call('get', KEYS[1]) + redis.call('get', KEYS[2]);" 2 key1 key2
redis-cli
- executes Redis command in bashEVAL
- evaluates specified LUA coderedis.call
- call Redis method'get'
- gets value by Redis keyKEYS[1]
- refers to first argument passed toEVAL
command (key1
)KEYS[2]
- refers to second argument passed toEVAL
command (key2
)2 key1 key2
- number of arguments we'll pass to the command and the arguments themselves
group: eval
redis-cli EVAL "return redis.call('get', KEYS[1]) + redis.call('get', KEYS[2]);" 2 key1 key2
(integer) 138