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
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
Did this help?

hasNext( )


Indicates if the query has more results.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:boolean
JavaScript
Did this help?

hasPrev( )


Indicates the query has previous results.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:boolean
Get whether the query result object has previous results
JavaScript
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 WixDataQueryResult may change.

Note: The next() function is not supported for Single Item Collections.

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:Promise<WixDataQueryResult>
JavaScript
Did this help?

prev( )


Retrieves the previous page of query results.

The prev() function retrieves the previous 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 prev() the values returned may change.

Note: The prev() function is not supported for Single Item Collections.

Method Declaration
Copy
function prev(): Promise<WixDataQueryResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<WixDataQueryResult>
Get the previous page of a query result
JavaScript
oldResults .prev() .then((results) => { let newResults = results; let items = newResults.items; let firstItem = items[0]; let totalCount = newResults.totalCount; let pageSize = newResults.pageSize; let currentPage = newResults.currentPage; let totalPages = newResults.totalPages; let hasNext = newResults.hasNext(); let hasPrev = newResults.hasPrev(); let length = newResults.length; let query = newResults.query; }) .catch((error) => { let errorMsg = error.message; let code = error.code; });
Did this help?