-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
None
Unlike the legacy uri parser, the spec-compliant uri parser does not filter out unsupported options from the uri string. In a particular case, users can specify the invalid option readConcern (should be readConcernLevel), and unintentionally overwrite our internal representation of a readConcern, leading to failed reads.
We should come up with a way to ensure this does not happen. Options include:
- console.warn when users do this. If we get a readConcern in the parsed options, we warn them that it’s not a supported option, and tell users to use readConcernLevel instead
- try to run JSON.parse on the passed-in readConcern, and if it passes + returns an object, use it. otherwise, assume user meant readConcernLevel
- Treat readConcern as readConcernLevel, with readConcernLevel taking precedence.