Search.../

hasNext( )

Indicates if the query has more results.

Syntax

function hasNext(): boolean

hasNext Parameters

This function does not take any parameters.

Returns

true if there are more results.

Return Type:

boolean

Was this helpful?

Get the next page of a query result

Copy Code
1const hasNext = results.hasNext(); // true
Iterate through all pages of query results

This example demonstrates how to get all query results, bypassing the maximum limit of 1000.

Copy Code
1import wixPricingPlansBackend from 'wix-pricing-plans-backend';
2
3async function retrieveAllItems() {
4 const allItems = [];
5
6 const results = await wixPricingPlansBackend.queryPublicPlans()
7 .limit(1000)
8 .find();
9 allItems.push(results.items);
10
11 while (results.hasNext()) {
12 results = await results.next();
13 allItems.push(results.items);
14 }
15 return allItems;
16}
17