QueryOptions

interface QueryOptions

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.

Properties

Link copied to clipboard
abstract val after: <Error class: unknown class>?

Opaque exclusive lower bound. Results must be strictly after this cursor in canonical ledger order.

Link copied to clipboard
abstract val before: <Error class: unknown class>?

Opaque exclusive upper bound. Results must be strictly before this cursor in canonical ledger order.

Link copied to clipboard
abstract val limit: <Error class: unknown class>?

The maximum number of items to return. Each method applies its own default and maximum. QueryEnd does not count against this limit.

Link copied to clipboard
abstract val ordering: Ordering?

Ordering for returned results. Defaults to ASCENDING.

Link copied to clipboard

Returns the field-presence view for this QueryOptions instance.

Functions

Link copied to clipboard
Link copied to clipboard
fun QueryOptions.copy(body: <Error class: unknown class>.() -> Unit = {}): QueryOptions

Copies the original message, including unknown fields.