reduce property

QueryReduceOperation<InstanceType> get reduce

Returns a new object that can execute functions like sum, average, maximum, etc.

The methods of this object will execute an aggregate function on the database table. For example, this property can be used to find the average age of all users.

    var query = Query<User>();
    var averageAge = await query.reduce.average((user) => user.age);

Any where clauses established by where or predicate will impact the rows evaluated and therefore the value returned from this object's instance methods.

Always returns a new instance of QueryReduceOperation. The returned object is permanently associated with this instance. Any changes to this instance (i.e., modifying where) will impact the result.

Implementation

QueryReduceOperation<InstanceType> get reduce;