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
|
numberWas this helpful?
Get
currentPage
from a query resultCopy Code
1const resultPage = results.currentPage;2
Perform a query and get
currentPage
from the resultCopy Code
1import { tags } from 'wix-blog-backend';23export async function myQueryFunction() {4 const results = await tags.queryTags().find();56 return results.currentPage;7}8