我使用 phpredis 扩展,当我调用时:
redis.call("ZREVRANGE", KEYS[1], start, endPos, 'WITHSCORES')
在 lua 脚本中,它返回
array(6) {
[0] =>
string(5) "10010"
[1] =>
string(2) "12"
[2] =>
string(5) "10012"
[3] =>
string(2) "-2"
[4] =>
string(5) "10011"
[5] =>
string(2) "-2"
}
实际上我想返回关联数组:
array(
"10010" => 12, "10012 => -2, ...
)