Search.../

totalPages

Returns the total number of pages the query produced.

Description

The page size is defined by the limit() function and can be retrieved using the pageSize property. You can use the next() and prev() functions returned by joinGroupRequests to navigate the pages of a query result.

Type:

number

Was this helpful?

Get totalPages from a query result

Copy Code
1const pageCount = results.totalPages;
2
Perform a query and get totalPages from the result

Copy Code
1import { joinGroupRequests } from 'wix-groups.v2';
2
3export async function myQueryFunction() {
4 const results = await joinGroupRequests.queryJoinGroupRequests().find();
5
6 return results.totalPages;
7}
8