The mongo data layer raises an exception when MONGO_URI does not contain a database name. However, the MongoDB URI syntax states that only the host is required and for good reasons.
In certain scenarios, it might be useful to set the ReplicaSet and other options with the URI, and then set the database dynamically with MONGO_DBNAME, maybe depending on the user performing the request.
The current implementation mimics Flask_PyMongo behavior. However, since we recently dropped that dependency, we are free to improve in this area.
The mongo data layer raises an exception when
MONGO_URIdoes not contain a database name. However, the MongoDB URI syntax states that only the host is required and for good reasons.In certain scenarios, it might be useful to set the ReplicaSet and other options with the URI, and then set the database dynamically with MONGO_DBNAME, maybe depending on the user performing the request.
The current implementation mimics Flask_PyMongo behavior. However, since we recently dropped that dependency, we are free to improve in this area.