Skip to content

Instantly share code, notes, and snippets.

@TheDeveloper
Created January 11, 2013 18:33
Show Gist options
  • Save TheDeveloper/4512889 to your computer and use it in GitHub Desktop.
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.
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