Skip to content

Instantly share code, notes, and snippets.

@mrkvm
Created October 21, 2012 22:51
Show Gist options
  • Save mrkvm/3928820 to your computer and use it in GitHub Desktop.
Save mrkvm/3928820 to your computer and use it in GitHub Desktop.
-- Get a key containing JSON in Redis
local key = KEYS[1];
local name = ARGV[1];
local data = redis.call('GET', key);
if not data then
return '';
else
local json = cjson.decode(redis.call('GET', key));
return json[name];
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment