modernAggregateCursor method
ModernCursor
modernAggregateCursor(})
This method returns a curosr that can be read or transformed into
a stream with stream
(for a stream you can directly call
modernAggregate
)
It corresponds to the legacy method aggregate()
The pipeline can be either an AggregationPipelineBuilder
or a
List of Maps (List<Map<String, Object>>
)
Implementation
ModernCursor modernAggregateCursor(dynamic pipeline,
{bool? explain,
Map<String, Object>? cursor,
String? hint,
Map<String, Object>? hintDocument,
AggregateOptions? aggregateOptions,
Map<String, Object>? rawOptions}) {
if (!db.masterConnection.serverCapabilities.supportsOpMsg) {
throw MongoDartError('At least MongoDb version 3.6 is required '
'to run the aggregate operation');
}
return ModernCursor(AggregateOperation(pipeline,
collection: this,
explain: explain,
cursor: cursor,
hint: hint,
hintDocument: hintDocument,
aggregateOptions: aggregateOptions,
rawOptions: rawOptions));
}