satyendra kumar
satyendra kumar

Reputation: 759

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

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?

Upvotes: 0

Views: 215

Answers (2)

user1774309
user1774309

Reputation: 467

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

Upvotes: 0

h4cc
h4cc

Reputation: 303

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

Upvotes: 1

Related Questions