Created
November 1, 2014 10:49
-
-
Save vivekhub/1f84d888edaabafb17a5 to your computer and use it in GitHub Desktop.
Implementing MDEL in Redis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!/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