sum static method

Map<String, Object?> sum(
  1. String field
)

Constructs a sum aggregation operation.

The field parameter specifies the field to sum.

Example:

var query = DQ.sum('field'); // { '\$sum': '\$field' }

Implementation

static Map<String, Object?> sum(String field) {
  return {'\$sum': '\$$field'};
}