Skip to content

Instantly share code, notes, and snippets.

@vivekhub
Created November 1, 2014 10:49
Show Gist options
  • Save vivekhub/1f84d888edaabafb17a5 to your computer and use it in GitHub Desktop.
Save vivekhub/1f84d888edaabafb17a5 to your computer and use it in GitHub Desktop.
Implementing MDEL in Redis
--!/usr/bin/env lua
local delpattern = KEYS[1]
local count = 0
local valuelist = redis.call('keys', delpattern)
if valuelist then
for i = 1, #valuelist do
redis.call('del', valuelist[i])
count = count + 1
end
end
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment