-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
We've had a number of reports of users being unable to connect existing applications after upgrading to PyMongo 4.x. The problem is the change of default value for directConnection from None (effectively True) to False. See PYTHON-2679 for details about the change, which brings PyMongo into compliance with DRIVERS-737.
Related user reports:
PYTHON-3246
PYTHON-3076
PYTHON-3240
PYTHON-3041
And a host of MongoDB community forum posts (and probably stackoverflow, but I haven't checked) and questions from internal teams.
In all cases the solution to the user problem is to add "directConnection=true" to their URI or pass directConnection=True as a keyword argument to MongoClient.
At the very least we need to make this change and its implications far more visible. Moving the changelog mention from it's current position buried in a long list of changes to the top of the list in warning text, adding warning text to the docstring for mongo_client.MongoClient, and providing examples of the kinds of problems users are likely to experience in the upgrade guide.
- is depended on by
-
PYTHON-3246 Starting from PyMongo v4+ can't connect to MongoDB via ssh
- Closed
- related to
-
PYTHON-2679 Auto discover replica sets by default
- Closed