hmarr / mongoengine

[Moved to mongoengine/mongoengine]
https://github.com/MongoEngine/mongoengine
MIT License
793 stars 20 forks source link

mongodb URI empty fields overwrite keyword arguments #598

Open edman opened 9 years ago

edman commented 9 years ago

The documentation states that

Database, username and password from URI string overrides corresponding parameters in connect()

In my understanding that meant that parameters passed through the URI would override keyword parameters, but it turns out that everything is overridden. Including information not specified in the URI.

In the following call username and password are given as keyword parameters, and later on (connection.py#L62) get overridden by the URI information, which is None. mongoengine.connect('mydb', username='user', password='passwd', host='mongodb://localhost:27017')