问题
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