groups

Specifies the server-side grouped data to be taken from the underlying raw data response object.

1. A string value specifying the path to the grouped data:

var dataSource = new shield.DataSource({
    schema: {
        groups: "groups"
    }
});

2. A function expression that accepts the raw response object and returns the grouped data:

var dataSource = new shield.DataSource({
    schema: {
        groups: function (result) {
            return result.groupedData;
        }
    }
});

In order for the server-side grouping to take effect, one must include the "group" operation in the list of remote operations.

The grouped items list should contain all the first-level groups, defined as dictionaries. Each group dictionary must contain:
- items - the data items of this group. Note that these can be either data items or nested sub-groups
- field - the path to the property by which items are grouped by
- value - the value of the above field for this group
- order - any sorting order of the groups - "asc" or "desc". Defaults to "asc"
- aggregate - any aggregation calculations applied on the items of this group. Each aggregation must contain the value of the aggregate function, calculated on the server-side