V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Cloudant
tsuibin
V2EX  ›  CouchDB

couchdb 的_all_docs 有没有分页?

  •  
  •   tsuibin · 2016-05-05 12:38:05 +08:00 · 4482 次点击
    这是一个创建于 2905 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我们可以通过访问_all_docs 或者当前数据库的所有记录条目,如果记录条目太多,_all_docs 是否提供了分页查询的 api ? 比如

     _all_docs?page=1&limit=20 
    

    之类的

    http://127.0.0.1:5984/detabase/_all_docs
    
    1 条回复    2018-10-07 10:22:29 +08:00
    iugo
        1
    iugo  
       2018-10-07 10:22:29 +08:00
    可以的.

    http://docs.couchdb.org/en/2.2.0/api/database/bulk-api.html 中有这样一句: Refer to the view endpoint documentation for a complete description of the available query parameters and the format of the returned data.

    因为 _all_docs 是内置视图的快捷方式, 所以所有视图中的参数与 _all_docs 应该也是管用的.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4750 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:52 · PVG 17:52 · LAX 02:52 · JFK 05:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.