Cloudant
tsuibin
V2EX  ›  CouchDB

couchdb 的_all_docs 有没有分页?

  •  
  •   tsuibin · May 5, 2016 · 5505 views
    This topic created in 3666 days ago, the information mentioned may be changed or developed.

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

     _all_docs?page=1&limit=20 
    

    之类的

    http://127.0.0.1:5984/detabase/_all_docs
    
    1 replies    2018-10-07 10:22:29 +08:00
    iugo
        1
    iugo  
       Oct 7, 2018
    可以的.

    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 应该也是管用的.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5284 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 08:44 · PVG 16:44 · LAX 01:44 · JFK 04:44
    ♥ Do have faith in what you're doing.