-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: CRUD, Read and Write Concern
User Story
As an application developer
I do not want the driver to throw an error when I explain an aggregation with a writeConcern
So I can get the correct server response with the queryPlanner results.
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 response, which ignores the option.
User Impact
The server does not error in this case so user catch blocks will just become dead code.
Dependencies
Unknowns
- None.
Acceptance Criteria
Implementation Requirements
- Remove the writeConcern check and throwing of the MongoInvalidArgumentError
Testing Requirements
- Change any tests asserting this throws to asseting an explain result is returned. If none exist then add a new test to avoid regressions.
Documentation Requirements
- Note in the release notes that this scenario will no longer throw and will return the correct results from the server.
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
-