QueryPaginationResult
Pagination metadata returned in query responses, including page size, offset, and optional total count.
Declaration
object QueryPaginationResultProperties
| Name | Type | Description |
|---|---|---|
pageSize | int32 | The number of rows actually returned in this response. May be smaller than the requested |
offset | int32 | The offset position for this response page. Echoes the |
totalCount | int64 | The total number of results matching the query. Only populated when |
Discussion
The QueryPaginationResult object is returned in the pagination field of query responses. It echoes offset from the request and provides totalCount when requested, but pageSize reports the number of rows actually returned in this response, not the requested page size. On the last page of a result set, this is often smaller than the pageSize you requested. Don’t rely on result.length == pagination.pageSize to detect the last page; instead, compare offset + pagination.pageSize against totalCount.
Example
A request with pagination: { "offset": 150, "pageSize": 50 } against a result set with 180 total matches returns only the remaining 30 rows on this page:
{
"pageSize": 30,
"offset": 150,
"totalCount": 180
}