Search.../

totalPages

Returns the total number of pages the query produced.

Description

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.

Type:

numberRead Only

Was this helpful?

Get the total number of pages in a query result

Copy Code
1const resultPages = results.totalPages; // 3
Perform a query and get the total number of pages in the result

Copy Code
1import wixPricingPlansBackend from 'wix-pricing-plans-backend';
2
3// ...
4
5wixPricingPlansBackend.queryPublicPlans()
6 .find()
7 .then((results) => {
8 const resultPages = results.totalPages; // 3
9 })
10 .catch((error) => {
11 const queryError = error;
12 });