We are pleased to announce the 4.11 release of PyMongo - MongoDB’s Python Driver.
Changes in Version 4.11.0
Warning
PyMongo 4.11 drops support for Python 3.8 and PyPy 3.9: Python 3.9+ or PyPy 3.10+ is now required.
Warning
PyMongo 4.11 drops support for MongoDB 3.6. PyMongo now supports MongoDB 4.0+. Driver support for MongoDB 3.6 reached end of life in April 2024.
Warning
Driver support for MongoDB 4.0 reaches end of life in April 2025. A future minor release of PyMongo will raise the minimum supported MongoDB Server version from 4.0 to 4.2. This is in accordance with MongoDB Software Lifecycle Schedules. Support for MongoDB Server 4.0 will be dropped in a future release!
Warning
This version does not include wheels for ppc64le or s390x architectures, see PYTHON-5058 for more information.
PyMongo 4.11 brings a number of changes including:
- Dropped support for Python 3.8 and PyPy 3.9.
- Dropped support for MongoDB 3.6.
- Dropped support for the MONGODB-CR authenticate mechanism, which is no longer supported by MongoDB 4.0+.
- pymongocrypt>=1.12 is now required for :ref:
In-Use Encryptionsupport. - Added support for free-threaded Python with the GIL disabled. For more information see: Free-threaded CPython. We do not yet support free-threaded Python on Windows (PYTHON-5027) or with In-Use Encryption (PYTHON-5024).
- :attr:
~pymongo.asynchronous.mongo_client.AsyncMongoClient.addressand :attr:~pymongo.mongo_client.MongoClient.addressnow correctly block when called on unconnected clients until either connection succeeds or a server selection timeout error is raised. - Added :func:
reprsupport to :class:pymongo.operations.IndexModel. - Added :func:
reprsupport to :class:pymongo.operations.SearchIndexModel. - Added
sortparameter to :meth:~pymongo.collection.Collection.update_one, :meth:~pymongo.collection.Collection.replace_one, :class:~pymongo.operations.UpdateOne, and :class:~pymongo.operations.UpdateMany, - :meth:
~pymongo.mongo_client.MongoClient.bulk_writeand :meth:~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_writenow throw an error whenordered=TrueorverboseResults=Trueare used with unacknowledged writes. These are unavoidable breaking changes. - Fixed a bug in :const:
bson.json_util.dumpswhere a :class:bson.datetime_ms.DatetimeMSwould be incorrectly encoded as'{"$date": "X"}'instead of'{"$date": X}'when using the legacy MongoDB Extended JSON datetime representation. - Fixed a bug where :const:
bson.json_util.loadswould raise an IndexError when parsing an invalid"$date"instead of a ValueError.
Issues Resolved
See the PyMongo 4.11 release notes in JIRA for the list of resolved issues in this release.