在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.获取多个key值 local result ={} for i = 1,#(KEYS) do result[i]= redis.call('get',KEYS[i]) end return result redis-cli示例: eval "local result={} for i = 1,#(KEYS) do result[i]= redis.call('get',KEYS[i]) end return result" 1 a 2.获取多个hash值 local result ={} local temp for i = 1,#(KEYS) do temp= redis.call('hgetall', KEYS[i]) result[i]=table.concat(temp,' ') end return result redis-cli示例: eval "local result ={} local temp for i = 1,#(KEYS) do temp = redis.call('hgetall', KEYS[i]) result[i]=table.concat(temp,' ') end return result" 1 a 参考:http://redisdoc.com/script/eval.html
|
请发表评论