Redis chaining commands
snippet in lua

Redis chaining commands

user7390

require "redis"
redis = Redis.new

redis.hset("foo","bar","baz")
redis.set("baz",42)

script = <<EOS
local k = redis.call("hget","foo",ARGV[1])
return redis.call("get",k)
EOS

puts redis.eval(script,keys:[],argv:["bar"])