非常感谢您的回信!
Best regards
Foyon
------------------ 原始邮件 ------------------
发送时间: 2013年7月9日(星期二) 凌晨5:45
收件人: "小凡"<1238...@qq.com>;
抄送: "openresty";
主题: Re: 关于zrangebyscore的limit问题
Hello!
On Thu, Jul 4, 2013 at 1:32 AM, 小凡 wrote:
> 您好,最近学习如何使用openresty,
> lua+redis
> 用到这个函数 zrangebysocre,limit的参数怎么传》?
> --local aSetId =
> instance:zrangebyscore('jsonjjmatch_ware_dict_usually',iTimeLine, iTime)
> local aSetId = instance:zrangebyscore('jsonjjmatch_ware_dict_usually',
> iTimeLine, iTime, {limit={0,10}})
>
2013/07/04 15:44:20 [error] 19003#0: *2004 lua handler aborted: runtime
> error: /usr/local/openresty/lualib/resty/redis.lua:196: bad argument #1 to
> 'len' (string expected, got table), client: 192.168.20.115, server:
> localhost, request: "GET /get_ware_dict?waretype=1&id=33&wareid= HTTP/1.1",
> host: "localhost:85"
>
> 只能传字符串?
lua-resty-redis 的命令格式与 redis 标准命令完全相同:
http://redis.io/commands/zrangebyscore比如 redis 官方文档中的这个例子
ZRANGEBYSCORE zset (1 5
在 Lua 中便等价于调用
local res, err = instance:zrangebyscore("zset", "(1", "5")
> 关于lua 访问redis的手册,或者文档能否提供一些资料?
除了上面给出的 redis 命令的官方手册,还有就是 lua-resty-redis 自身的 README 文档:
https://github.com/agentzh/lua-resty-redis#name同时抄送给 openresty 中文邮件列表:
https://groups.google.com/group/openresty建议你加入此列表并总是在那里交流这样的问题,谢谢合作!
Best regards,
-agentzh