lua 用redis的hgetall的问题
在lua脚本里,调用redis的hgetall, 返回的难道是数组,不是字典么??
比如:
dict = {}
dict["test1"] = 1
dict["test2"] = 2
dict["test3"] = 3
--存入redis
red:hmset(key,dict)
--从redis取出整个table
t = red:hgetall(key)
--死活没法用field取得正确的value,例如
print (t["test1"]) --等于nil
print (t[1]) --等于test1
print (t[2]) --等于1
请问这是lua的redis结构中hgetall的实现问题,还是我用法有问题