MongoEngine/mongoengine

Wrong URI options parsing

x-mass opened this issue · 1 comments

x-mass commented

When connecting with a URI strings including replicaSet, authSource, authMechanism or readPreference, mentioned options parsing is broken.
There are the lines doing parsing. They compare options, parsed with pymongo.uri_parser.parse_uri() (gives parameters as is, don't change a case), to lowercase namings. But it URI strings options are in camelCase, as mentioned in official docs.
Have to change comparison strings to proper camelCase format

Please provide a reproducible snippet if issue still exists, the uri options is a CaseInsensitiveDictionary so it should work as expected

uri_options: _CaseInsensitiveDictionary = uri_dict["options"]