aggregateToStream method

Stream<Map<String, dynamic>> aggregateToStream(
  1. List<Map<String, Object>> pipeline, {
  2. Map<String, Object> cursorOptions = const <String, Object>{},
  3. bool allowDiskUse = false,
})

Executes an aggregation pipeline

Implementation

Stream<Map<String, dynamic>> aggregateToStream(
    List<Map<String, Object>> pipeline,
    {Map<String, Object> cursorOptions = const <String, Object>{},
    bool allowDiskUse = false}) {
  if (db._masterConnectionVerified.serverCapabilities.supportsOpMsg) {
    return modernAggregate(pipeline,
        cursor: cursorOptions,
        aggregateOptions: AggregateOptions(allowDiskUse: allowDiskUse));
  }
  return legacyAggregateToStream(pipeline,
      cursorOptions: cursorOptions, allowDiskUse: allowDiskUse);
}