Created
January 11, 2013 18:33
-
-
Save TheDeveloper/4512889 to your computer and use it in GitHub Desktop.
Lua script for use in redis. Deletes all keys matching argument 1. Returns count for total number of keys deleted.
This file contains hidden or 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
local keys | |
keys = redis.call('keys', KEYS[1]) | |
local ret=0 | |
local type | |
for k,v in pairs(keys) do | |
redis.call('del', v) | |
ret = ret+1 | |
end | |
return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment