totalCount


totalCountnumberRead-only

Returns the total number of items that match the query.

The totalCount returns the total number of items that match the query, not just the number of items in the current page.

JavaScript
const resultCount = results.totalCount; // 150
Did this help?

totalPages


totalPagesnumberRead-only

Returns the total number of pages the query produced.

The page size is defined by the limit() function, can be retrieved using the pageSize property, and navigating through pages is done with the prev() and next() functions.

JavaScript
const resultPages = results.totalPages; // 3
Did this help?

hasNext( )


Indicates if the query has more results.

Method Declaration
Copy
function hasNext(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
JavaScript
const hasNext = results.hasNext(); // true
Did this help?

hasPrev( )


Indicates if the query has previous results.

Method Declaration
Copy
function hasPrev(): boolean;
Request
This method does not take any parameters
Returns
Return Type:boolean
Get the previous page of a query result
JavaScript
const hasPrev = results.hasPrev(); // false
Did this help?

next( )


Retrieves the next page of query results.

The next() function retrieves the next page of query results.

The page size is defined by the limit() function, can be retrieved using the pageSize property, and navigating through pages is done with the prev() and next() functions.

If items are added or removed between calls to next() the values returned by EventsQueryResult may change.

Method Declaration
Copy
function next(): Promise<EventsQueryResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<EventsQueryResult>
JavaScript
oldResults .next() .then((results) => { const newResults = results; const items = newResults.items; const firstItem = items[0]; const totalCount = newResults.totalCount; const pageSize = newResults.pageSize; const currentPage = newResults.currentPage; const totalPages = newResults.totalPages; const hasNext = newResults.hasNext(); const hasPrev = newResults.hasPrev(); const length = newResults.length; const query = newResults.query; }) .catch((error) => { const queryError = error; });
Did this help?