group( )


Developer Preview

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

Groups items together in an aggregation.

The group() method refines a WixDataAggregate so that its items are grouped by the specified field or fields.

You can perform aggregations on the groups using the following methods:

  • avg()
  • count()
  • max()
  • min()
  • sum()

To filter grouped results, use the having() method.

Notes:

  • Aggregations can only be used on collections you have created. They cannot be used on Wix app collections.
  • You can only call the group() method once per aggregate query.
Method Declaration
Copy
Method Parameters
fieldArray<string>Required

Field or fields to group on.

Returns
Return Type:WixDataAggregate
Did this help?