public
Created

MEXISTS Redis Lua script

  • Download Gist
mexists.lua
Lua
1 2 3 4 5 6 7 8 9 10 11 12 13
$ cat /tmp/mexists.lua
 
local retval,j
retval={}
for i=1,#KEYS do
table.insert(retval,redis.call('exists',KEYS[i]))
end
return retval
 
$ ./redis-cli --eval /tmp/mexists.lua foo bar key0
1) (integer) 0
2) (integer) 0
3) (integer) 1

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.