Skip to content

Instantly share code, notes, and snippets.

@fatihky
Forked from mrkvm/iterating_over_hash.lua
Last active August 29, 2015 14:06
Show Gist options
  • Save fatihky/e202cd478e06d65f17d0 to your computer and use it in GitHub Desktop.
Save fatihky/e202cd478e06d65f17d0 to your computer and use it in GitHub Desktop.
-- iterate over Redis hash in Lua.
local results = redis.call("HGETALL", KEYS[1]);
if results ~= 0 then
for key, value in ipairs(results) do
-- do something here
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment