createAggregateCommand static method
Implementation
static DbCommand createAggregateCommand(
Db db, String collectionName, List pipeline,
{bool allowDiskUse = false, Map<String, dynamic>? cursor}) {
var query = {'aggregate': collectionName, 'pipeline': pipeline};
if (cursor != null) query['cursor'] = cursor;
if (db.masterConnection.serverCapabilities.aggregationCursor) {
query['allowDiskUse'] = allowDiskUse;
}
return DbCommand(db, SYSTEM_COMMAND_COLLECTION,
MongoQueryMessage.OPTS_NO_CURSOR_TIMEOUT, 0, -1, query, null);
}