Filters out groups from being returned from an aggregation.
The having()
function refines a WixDataAggregate
so that it only
includes groups from the aggregate's grouping which match the specified
filter criteria.
To create a filter, use the wix-data filter()
function.
Filtering using having()
takes place after grouping is performed on the
aggregation. To filter items before grouping, use the filter()
function.
Note: Aggregations can only be used on collections you have created. They cannot be used on Wix App Collections.
function having(filter: WixDataFilter): WixDataAggregate;
The filter to use to filter out groups from being returned from the aggregation.
let having = wixData.filter().gt("maxPopulation", 1000000);
let newAggregate = aggregate.having(having);
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.