Created
November 16, 2018 04:48
-
-
Save torao/99bef9042babc4fd95f7043cdbeb1278 to your computer and use it in GitHub Desktop.
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 hmgetall = function(...) | |
if next(arg) == nil then return [] end | |
local result = [] | |
for j, key in ipairs(arg) do | |
local bulk = redis.call('HGETALL', key) | |
local hash = {} | |
local nextfield | |
for i, v in ipairs(bulk) do | |
if i % 2 == 1 then | |
nextkey = v | |
else | |
hash[nextkey] = v | |
end | |
end | |
result[j] = hash | |
end | |
return result | |
end | |
return hmgetall(KEYS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment