-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In PYTHON-461 and PYTHON-1305, some work has been done to provide for nicer handling of soliciting the database name from the URI, but one common use-case is still missing: the ability for the application to provide a default database name but for the user of the application to supply a URI superseding that name.
This need is illustrated in this helper function.
At one point, I thought that MongoClient(uri).get_database(default) would work, but it doesn't because that usage assumes that the supplied name supersedes the name in the URI.
It would be nice if the interface could allow the programmer to supply a default and for the user to override that default (without having to dance around the interface like this helper function does).
*Edit: fixed link.
- is related to
-
MOTOR-401 Add MotorClient.get_default_database
- Closed
-
PYTHON-1305 Remove MongoClient.get_default_database
- Closed