MongoDB · Types · Queries

ArxPagingInfo

Definition

Namespace
ARX.SDK.Query
Package
ARX.SDK
C#
public class ArxPagingInfo

Paging for RetrieveMultiple: the page size (Count, 5,000 by default) and the 1-based page number. The total is opt-in (ReturnTotalRecordCount): it counts every matching row, a second statement in the same round trip.

Constructor

  • ArxPagingInfo()

    Page 1 of 5,000 rows, without the total.

Properties

  • int Count { get; set; }

    The page size: at most this many rows per page.

  • int PageNumber { get; set; }

    The page to read, from 1.

  • bool ReturnTotalRecordCount { get; set; }

    True to count every matching row as well (TotalRecordCount, TotalPageCount): a second statement in the same round trip. Leave it off when the screen doesn't show the total.

  • string? PagingCookie { get; set; }

    Token paging: the ArxEntityCollection.PagingCookie of the previous page, to read the page after it; null (the default) for the first page. The cookie is opaque, written by the provider that read the previous page, for the same query: never build or change one. With a cookie, leave PageNumber at 1. Only providers that declare ArxCapability.TokenPaging accept it; the others refuse it (ARX8001 NotSupported) rather than ignore it.

Methods

  • ArxPagingInfo? Next(Services.ArxEntityCollection page)

    The paging that reads the page after page, on any provider: by its cookie where the provider returned one (MongoDB, DynamoDB), by the next page number where it didn't (PostgreSQL, SQL Server, MySQL); null when no page follows. Same page size; the total isn't asked for again. A loop that only passes the cookie on reads the first page again on a provider without cookies, so a loop meant to run everywhere ends each page with query.PageInfo = query.PageInfo.Next(page) and stops on null.

    Parameter Type Description
    pageServices.ArxEntityCollectionThe page the query with this paging returned.

Usage

C#

A line from a verified sample; the full, runnable code is on its page.

query.PageInfo = new ArxPagingInfo { Count = 3, PageNumber = 2, ReturnTotalRecordCount = true };

Page through results, scenario 1

Used in: