aggregates

Specifies the list of server-side aggregates to be taken from the underlying raw data response object.

1. A string value specifying the path to the aggregates list:

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

2. A function expression that accepts the raw response object and returns the aggregates list:

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

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

The aggregates list is a list of dictionaries, each one containing the field being aggregates, the aggregate function and the value storing the result of the aggregate function, that the DataSource will use.