Cleanup
This commit is contained in:
12
node_modules/mongodb/lib/operations/aggregate.js
generated
vendored
12
node_modules/mongodb/lib/operations/aggregate.js
generated
vendored
@@ -37,10 +37,8 @@ class AggregateOperation extends CommandOperationV2 {
|
||||
this.readPreference = ReadPreference.primary;
|
||||
}
|
||||
|
||||
if (options.explain && (this.readConcern || this.writeConcern)) {
|
||||
throw new MongoError(
|
||||
'"explain" cannot be used on an aggregate call with readConcern/writeConcern'
|
||||
);
|
||||
if (this.explain && this.writeConcern) {
|
||||
throw new MongoError('"explain" cannot be used on an aggregate call with writeConcern');
|
||||
}
|
||||
|
||||
if (options.cursor != null && typeof options.cursor !== 'object') {
|
||||
@@ -83,9 +81,8 @@ class AggregateOperation extends CommandOperationV2 {
|
||||
command.hint = options.hint;
|
||||
}
|
||||
|
||||
if (options.explain) {
|
||||
if (this.explain) {
|
||||
options.full = false;
|
||||
command.explain = options.explain;
|
||||
}
|
||||
|
||||
command.cursor = options.cursor || {};
|
||||
@@ -100,7 +97,8 @@ class AggregateOperation extends CommandOperationV2 {
|
||||
defineAspects(AggregateOperation, [
|
||||
Aspect.READ_OPERATION,
|
||||
Aspect.RETRYABLE,
|
||||
Aspect.EXECUTE_WITH_SELECTION
|
||||
Aspect.EXECUTE_WITH_SELECTION,
|
||||
Aspect.EXPLAINABLE
|
||||
]);
|
||||
|
||||
module.exports = AggregateOperation;
|
||||
|
||||
Reference in New Issue
Block a user