aggregate method
Runs a specified admin/diagnostic pipeline which does not require an
underlying collection. For aggregations on collection data,
see dbcollection.modernAggregate()
.
Implementation
Stream<Map<String, dynamic>> aggregate(List<Map<String, Object>> pipeline,
{bool? explain,
Map<String, Object>? cursor,
String? hint,
Map<String, Object>? hintDocument,
AggregateOptions? aggregateOptions,
Map<String, Object>? rawOptions}) {
if (!masterConnection.serverCapabilities.supportsOpMsg) {
throw MongoDartError('At least MongoDb version 3.6 is required '
'to run the aggregate operation');
}
return ModernCursor(AggregateOperation(pipeline,
db: this,
explain: explain,
cursor: cursor,
hint: hint,
hintDocument: hintDocument,
aggregateOptions: aggregateOptions,
rawOptions: rawOptions))
.stream;
}