How to limit the numbers of records fetched from couchdb using view

為{幸葍}努か 提交于 2019-12-12 01:45:31

问题


I have created a view and it contains thousands of records I want get only 10 or 20 at a time ,for this I tried to use http://localhost:5984/recipes/_design/recipes/_view/by_recipe?limit=2 which is not working ,Still it is giving me entire data.

How can I achieve this?


回答1:


Maybe you need to use limit in combination with skip, according to these docs: https://wiki.apache.org/couchdb/HTTP_view_API




回答2:


It is better if you use the startkey and limit to avoid slow response in large number of documents. In the same URL above, you will find this. For example: http://127.0.0.1:5984/mybd/_design/myviews/_view/get?startkey="blabla1"&limit=2



来源:https://stackoverflow.com/questions/31915327/how-to-limit-the-numbers-of-records-fetched-from-couchdb-using-view

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!