count( )


Developer Preview

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

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

The count() method refines a WixDataAggregate contains 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. You can set a custom key using the projectedField parameter.
  • 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
Method Parameters
projectedFieldstring

Field in the aggregation results that contains the count value. Default: count.

Returns
Return Type:WixDataAggregate
Did this help?