count( )


Refines a WixDataAggregate to contain the item count of each group in the aggregation.

The count() function refines a WixDataAggregate to contain the item count in each of the aggregate's groups.

When the aggregation is run, the returned WixDataAggregateResult object contains items with the following additional key:value pair:

  • The key is named "count".
  • The value is the count of items aggregated in the group.

Note: Aggregations can only be used on collections you have created. They cannot be used on Wix App Collections.

Method Declaration
Copy
function count(): WixDataAggregate;
Request
This method does not take any parameters
Returns
Return Type:WixDataAggregate
JavaScript
let newAggregate = aggregate.count();
Errors

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

Did this help?