Skip to content

Instantly share code, notes, and snippets.

@tal
Created February 2, 2013 19:27
Show Gist options
  • Select an option

  • Save tal/4698905 to your computer and use it in GitHub Desktop.

Select an option

Save tal/4698905 to your computer and use it in GitHub Desktop.
local isdigest = redis.call('srem', "digest:users", ARGV[1])
local keys = redis.call('keys', "digest:"..ARGV[1]..":*")
local ret = {}
for i,key in ipairs(keys) do
local dict = {}
local keyname = key:gsub("digest:"..ARGV[1]..':','')
local members = redis.call('lrange', key,0 ,-1)
table.insert(dict,keyname)
table.insert(dict,members)
table.insert(ret,dict)
redis.call('del',key)
end
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment