Query Options
Cursor-bounded query options.
after and before are canonical ledger-position bounds, not ordering-relative cursors. after always excludes items at or below that cursor, and before always excludes items at or above that cursor. Ordering only controls the order of returned items within the resulting open interval.
When a request also specifies a checkpoint range, cursor bounds and checkpoint bounds compose by intersection: results come only from ledger positions inside both. Checkpoint bounds are likewise canonical and ordering-independent.
For example, with after = A, before = B, ordering = DESCENDING, and limit = N, the response contains up to N matching items in descending order from the interval (A, B). If the response ends with QUERY_END_REASON_ITEM_LIMIT, resume by keeping after = A and setting before to the last Watermark.cursor received. That cursor is the lowest position reached in ledger order, so it becomes the next exclusive upper bound.