Created
October 21, 2012 22:51
-
-
Save mrkvm/3928820 to your computer and use it in GitHub Desktop.
This file contains 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
-- 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