Skip to content

Instantly share code, notes, and snippets.

@antirez
Created December 14, 2011 09:22
Show Gist options
  • Save antirez/1475853 to your computer and use it in GitHub Desktop.
Save antirez/1475853 to your computer and use it in GitHub Desktop.
MEXISTS Redis Lua script
$ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment