When you execute an aggregation with the run()
function, it returns
a Promise that resolves to a WixDataAggregateResult
object, which contains
the aggregated values.
let items = results.items;
Returns the number of values in the aggregate results.
let length = results.length; // 4
Indicates if the aggregation has more results.
function hasNext(): boolean;
let hasNext = results.hasNext(); // true
Retrieves the next page of aggregate results.
The next()
function retrieves the next page of aggregate results.
The page size is defined by the limit()
function.
If items are added or removed between calls to next()
the values returned
by WixDataAggregateResult
may change.
function next(): Promise<WixDataAggregateResult>;
oldResults
.next()
.then((newResults) => {
let items = newResults.items;
let numItems = newResults.length;
let hasNext = newResults.hasNext();
})
.catch((error) => {
let errorMsg = error.message;
let code = error.code;
});