next( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves the next page of query results.

The next() method retrieves the next page of query results.

The page size is defined by the limit() method, can be retrieved using the pageSize property, and navigating through pages is done with the prev() and next() methods.

If items are added or removed between calls to next() the values returned may change.

Note: The next() method is not supported for single-item collections.

Method Declaration
Copy
function next(): Promise<WixDataResult>;
Request
This method does not take any parameters
Returns
Return Type:Promise<WixDataResult>
JavaScript
async function queryNextPage(oldResults) { const newResults = await oldResults.next(); const items = newResults.items; const firstItem = items[0]; const pageSize = newResults.pageSize; const currentPage = newResults.currentPage; const hasNext = newResults.hasNext(); const hasPrev = newResults.hasPrev(); const length = newResults.length; }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?