-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Connection String
-
Needed
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Use Case
As a Node.js deveoper
I want proper URI and MongoClient options
So that I can leverage different driver and Node native options.
User Impact
- Customers passing Node native TLS options in the URI via mongosh
- A misplaced option throws, consistent with the existing hardcoded cases in connection_string.ts (serverApi in the URI, loadBalanced in the constructor)
Dependencies
- None
Unknowns
- None
Acceptance Criteria
Implementation Requirements
- Separate the allowlist of URI-supported options from the allowlist of constructor-supported options (via shared, uri-only, and constructor-only options)
- Use the corresponding allowlist when validating the options during parsing
- Ensure we continue to prefer the constructor options over the URI options when both are specified
- Update the the currently misdocumented MongoClientOptions type to draw from the correct allowlist of options and clearly indicate that the options are constructor-only
- Ensure that w, journal, and wtimeoutMS, along with loadBalanced are on the uri-only list
- Ensure that writeConcern and serverApi are on the constructor-only list
- Review the remaining shared options to ensure that they should, in fact, be shared
- Allow for pass through Node.js TLS options that accept strings, booleans or numbers to be allowed in the URI: ciphers, ecdhCurve, passphrase, rejectUnauthorized, servername
- Allow for paas through Node.js TLS options to all be accepted as client options.
- fsync, j and wtimeout remain accepted on the uri-only list, still deprecated. Their removal is out of V8 scope (NODE-5275)
Testing Requirements
- Add connection string unit tests for ciphers, ecdhCurve, passphrase, rejectUnauthorized, servername to ensure they get properly set/converted to options.
Documentation Requirements
- Add DOCSP ticket to add the native Node.js TLS options support.
- Communicate changes to the docs team, including the new sources of truth for URI vs constructor supported options AND make sure the precedence of constructor options over URI options is clearly called out
Follow Up Requirements
- None
- has to be done after
-
NODE-4015 Standardize Connection String Validation Errors and MongoParseError
-
- Backlog
-
- is depended on by
-
COMPASS-9643 Investigate changes in NODE-5886: Consolidate URI and Client Options
-
- Waiting (Blocked)
-
- related to
-
NODE-5275 Remove write concern related deprecations
-
- Backlog
-