Skip to content

Instantly share code, notes, and snippets.

@tal
Created February 4, 2013 17:45
Show Gist options
  • Select an option

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

Select an option

Save tal/4708255 to your computer and use it in GitHub Desktop.
Returns a hash of arrays with the key being everything that `*` matches and the value being the contents of the list
local keys = redis.call('keys',KEY[1])
local ret = {}
for i,key in ipairs(keys) do
local keyname = key:sub(1,-2)
local members = redis.call('lrange', key,0 ,-1)
ret[i] = {keyname, members}
end
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment