$buildCommand method
Implementation
@override
Map<String, Object> $buildCommand() {
// on null collections (only aggregate) the query is performed
// on the admin database
if (collection == null) {
options[keyDbName] = 'admin';
}
return <String, Object>{
keyAggregate: collection?.collectionName ?? 1,
keyPipeline: pipeline,
if (explain) keyExplain: explain,
keyCursor: cursor,
if (hint != null)
keyHint: hint!
else if (hintDocument != null)
keyHint: hintDocument!,
};
}