开发者社区> 问答> 正文

[openresty]lua 读取redis 查询问题?报错

求助解决: openresty中lua+redis,关于lua查询redis方法的手册,我在用zrangebyscore时的分页,resty只支持字符串,有相关说明文档吗?

 local aSetId = instance:zrangebyscore('jsonjjmatch_ware_dict_usually', iTimeLine, iTime)

这样能获取整个,但是我需要 limit取,我看redis.lua中只能传字符串,

 local aSetId = instance:zrangebyscore('jsonjjmatch_ware_dict_usually', iTimeLine, iTime,{limit={0, 10}})

报错:2013/07/04 16:58:19 [error] 19015#0: *2160 lua handler aborted: runtime error: /usr/local/openresty/lualib/resty/redis.lua:196: bad argument #1 to 'len' (strin
      g 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"

展开
收起
爱吃鱼的程序员 2020-06-22 18:33:57 718 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    localaSetId=instance:zrangebyscore('jsonjjmatch_ware_dict_usually',iTimeLine,'limit','0','10')

    这样写。最好能有相关文档

    Re:关于zrangebyscore的limit问题 openresty作者回复了我的邮件,非常感谢!!! 开发  OpenResty  lua模块是,不提示详细错误,请问怎样调试??

    你是指用openresty时候,不报错?

    nginx配置日志报错等级,notice,或者更低点等级debug

    error_log logs/error.log notice;

    2020-06-22 18:34:14
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Redis在唯品会的应用实践——架构演进与功能定制 立即下载
微博的Redis定制之路 立即下载
云数据库Redis版的开源之路 立即下载