Reputation: 1317
I wrote a Couchbase view and I'm querying this view from Python. Instead of the full set of data being returned, it is only returning the first 10 elements.
I don't want pagination, instead of pagination I want the entire set of data. Is there any way of doing this?
Below is my view code:
function (doc, meta) {
if (doc.type == "folder" && doc.location) {
emit(doc.location, meta.id);
}
}
And here is the Python code I wrote to run the query:
view_endpoint = "_design/restViews/_view/"+viewName+"?key=%22"+key
response = requests.get(view_url + view_endpoint).json()
return response
Upvotes: 4
Views: 258
Reputation: 1865
A Trusty source says:
When querying the view results, a number of parameters can be used to select, limit, order and otherwise control the execution of the view and the information that is returned. When a view is accessed without specifying any parameters, the view will produce results matching the following: Full view specification, i.e. all documents are potentially output according to the view definition.Limited to 10 items within the Admin Console, unlimited through the REST API.Reduce function used if defined in the view.Items sorted in ascending order (using UTF–8 comparison for strings, natural number order)
You can add parameters to the query before the view. One of them is:
limit: numeric Limit- the number of the returned documents to the specified number.
Good luck. :)
Upvotes: 1