Deta Base fetch pagination cursor binding to query predicates prevents mid-iteration filter refinement
0 reputation · 18 Jul 2023, 06:11 UTC
0 reputation · 18 Jul 2023, 06:11 UTC
Deta Base fetch() returns a maximum of 1,000 items per call and uses an opaque last cursor for subsequent pages. The cursor is bound to the exact query predicate supplied in the initial call; altering any condition operator or attribute between paginated requests invalidates the cursor and restarts iteration from the beginning.
Enable a consumer to paginate through a large, query-bounded dataset while retaining the ability to narrow or adjust filter criteria after inspecting early pages — for example, adding a secondary attribute filter once a broad category scan reveals the data distribution.
last cursor cannot be reused with a modified query parameter; the documentation states that changing the predicate restarts the scan.last cursor encode enough information to allow a consumer to reconstruct an equivalent query that resumes at the same logical offset after a predicate change?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.