Skip to main content

Interface: PaginationOptions

server.PaginationOptions

The options passed to paginate.

To use this type in argument validation, use the paginationOptsValidator.

Properties

numItems

numItems: number

Number of items to load in this page of results.

Note: This is only an initial value!

If you are running this paginated query in a reactive query function, you may receive more or less items than this if items were added to or removed from the query range.

Defined in

server/pagination.ts:78


cursor

cursor: null | string

A Cursor representing the start of this page or null to start at the beginning of the query results.

Defined in

server/pagination.ts:84


endCursor

Optional endCursor: null | string

A Cursor representing the end of this page or null | undefined to use numItems instead.

This explicitly sets the range of documents the query will return, from cursor to endCursor. It's used by reactive pagination clients to ensure there are no gaps between pages when data changes, and to split pages when pageStatus indicates a split is recommended or required.

When splitting a page, use the returned splitCursor as endCursor for the first half and as cursor for the second half.

Defined in

server/pagination.ts:98


maximumRowsRead

Optional maximumRowsRead: number

The maximum number of rows to read from the database during pagination.

This limits rows entering the query pipeline before filters are applied. Use this when filtering for rare items, where low numItems won't bound execution time because the query scans many rows to find matches.

Currently this is not enforced for search queries.

Defined in

server/pagination.ts:109


maximumBytesRead

Optional maximumBytesRead: number

The maximum number of bytes to read from the database during pagination.

This limits bytes entering the query pipeline before filters are applied. Use this to control bandwidth usage when documents are large. If the limit is reached, the query may return an incomplete page and require a page split.

Currently this is not enforced for search queries.

Defined in

server/pagination.ts:121