You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
For a view query to be paginated, you just use the limit=10 then subsequent call would be limit=10 & skip=10 (these are settings you can apply to the Query class returned by the clients createViewQuery()). With this method your paging logic would have to guard against less than 10 rows being returned as this would indicate the "end of pages". If done via an API you would need to return the current_skip_value and next_skip_value to the API client so they could know how many records to skip next time.
The alternitive way is via the what the couchdb documenation refers to as the "paging" method.
EG: For a 10 record page, you would ask for 11 rows back, you only display up to the 10th row and you return the 11th id as your "next_start_key". Subsequent requests would specify start_key as the previous next_start_key. NOTE: becasue the view keys do not have to be unique, I normally use start_key_docid for this instead as this will break if the keys are not unique (and in a lot of cases mine are not).
how to pagination ?
The text was updated successfully, but these errors were encountered: