groupBy method

Map<String, List<T>> groupBy(
  1. String fieldName
)

Implementation

Map<String, List<T>> groupBy(String fieldName) {
  Map<String, List<T>> result = {};
  final groups = _harnCollection.groupBy(fieldName);
  groups.forEach((key, value) {
    Map<String, List<T>> r = {};
    r["$key"] = value.map((e) => fromMap(e)).toList();
    result.addAll(r);
  });

  harnLog.register({"groupBy": result});

  return result;
}