group static method

Map<String, Object> group(
  1. Map<String, Object?> query
)

Constructs a MongoDB aggregation group stage.

The query parameter should define the grouping operation.

Example:

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

Implementation

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