-
Type: Task
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Use Case
As a user of the driver
I want to know when I am passing incorrect option types
So that I can know if my code actually works as intended
User Impact
- Ignoring incorrect option types leads to confused users (e.g.,
NODE-3650) and potentially silent failures in their production code.
Dependencies
- None
Unknowns
- The complete list of options that is not strictly validated
- Do we want to do this for mongo client options or just collection/database api options?
Acceptance Criteria
- For every option that is explicitly parsed/transformed from user input (instead of being assigned directly), log a warning if the original option value does not match the expected typescript type
- Do this for all collection/db api's, including admin
- Determine whether any client options are affected by this behavior and log warnings there, too, if applicable
Testing Requirements
- Add tests to ensure warnings are logged for the expected options
Documentation Requirements
- Document the behavior described in
NODE-3650in the 4.x upgrade guide, unless already done by this point; call out any other option types that may be ignored instead of applied.
Follow Up Requirements
- File a ticket to start throwing errors instead of just warnings in 5.0
- related to
-
NODE-3650 Document in upgrade guide that boolean API options are strictly checked to be booleans
- Closed