Giter Site home page Giter Site logo

hexists 和 hkeys 需要完善 about ssdb HOT 4 CLOSED

ideawu avatar ideawu commented on May 19, 2024
hexists 和 hkeys 需要完善

from ssdb.

Comments (4)

ideawu avatar ideawu commented on May 19, 2024

@moolex 你好, hkeys 支持分页, 参数为 hkeys($name, $key_start, $key_end, $limit). 如果需要判断表中是否存在某个key, 目前可以使用multi_hget, 未来会增加方法.

from ssdb.

moolex avatar moolex commented on May 19, 2024

关于hkeys的接口意义,我在实验中发现是这样的:

比如我有3个key值,a1,b2,c3

如果我想搜索出来b2,我就要用 hkeys(name, 'a', 'c', 1);

我的需求是按照key值的prefix来进行检索,发现只能对这个prefix的最后一位字符进行ASCII-1作为key_start,ASCII+1作为key_end,然后那个limit只能作为一次获取限制,不能用作分页了。

我总是觉得我这个使用方法不太对劲,但也没看到详细的说明文档,所以想请教下正确的使用方法是什么呢?谢谢

from ssdb.

ideawu avatar ideawu commented on May 19, 2024

hi, ssdb数据集合的分页是游标分页, 和数据库的limit start, size, 不一样. 假设数据列表为:

a, b, c, d, e, f, g

想分页, 每页2条记录. 那么第一页 hkeys h "" "" 2, 返回

a, b

然后下一页, hkeys h b "" 2

from ssdb.

moolex avatar moolex commented on May 19, 2024

喔,原来是这样,我明白了。谢谢解答,希望SSDB可以越做越好!

from ssdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.