Search.../

currentPage

Returns the index of the current results page number.

Description

The currentPage is a zero-based index of the current page of 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.

The currentPage property returns undefined if the query returned no results.

Type:

numberRead Only

Was this helpful?

Get the current page index of a query result

Copy Code
1let resultPage = results.currentPage; // 0
Perform a query and get the current page index of the query result

Copy Code
1import wixData from 'wix-data';
2
3// ...
4
5wixData.query("myCollection")
6 .find()
7 .then((results) => {
8 let resultPage = results.currentPage; // 0
9 }) ;