Search.../

currentPage

Returns the index of the current page of results.

Description

currentPage is a zero-based index of the current page of results, meaning the 1st page is 0, the 2nd page is 1, and so on. If no results match the query, currentPage is undefined. 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 tags to navigate the pages of a query result.

Type:

undefined

 | 

number

Was this helpful?

Get currentPage from a query result

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

Copy Code
1import { tags } from 'wix-blog-backend';
2
3export async function myQueryFunction() {
4 const results = await tags.queryTags().find();
5
6 return results.currentPage;
7}
8