-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Use Case
The AggregateOperation constructor has logic to throw an error if an aggregation is constructed with explain and writeConcern set (https://github.com/mongodb/node-mongodb-native/blob/5b3d01b824587dfa75f36ef9e55f6559d5fc5fe9/src/operations/aggregate.ts#L71). Instead, the node driver should not throw an error and rely on the server to report the error where appropriate.
User Impact
Users will see errors in the same scenarios, but the error will be generated by the server and not the driver. This will change the error from a MongoInvalidArgumentError to a MongoServerError.
Dependencies
Unknowns
- Can this go out in a patch/minor release as a bug fix, or do we need to wait until a major release? We currently guarantee that `instanceof` checks on errors will be semver compliant - https://github.com/mongodb/node-mongodb-native#error-handling.
Acceptance Criteria
- Don't send writeConcern when explain are both used.
Implementation Requirements
Testing Requirements
Documentation Requirements
- n/a
Follow Up Requirements
- n/a
- is depended on by
-
MONGOSH-1002 When executing explain on aggregate it generates an error with WriteConcern
- Waiting (Blocked)
- related to
-
SERVER-28678 The explain command should reject explained commands containing readConcern or writeConcern
- Closed