Changelog¶
Changes in Version 4.17.0 (2026/04/20)¶
PyMongo 4.17 brings a number of changes including:
has_key,iterkeysanditervaluesinbson.son.SONhave been deprecated and will be removed in PyMongo 5.0. These methods were deprecated in favor of the standard dictionary containment operatorinand thekeys()andvalues()methods, respectively.Added the
bind()andbind()methods that allow users to bind a session to all database operations within the scope of a context manager instead of having to explicitly pass the session to each individual operation. See the Transactions docs for examples and more information.Added support for MongoDB’s Intelligent Workload Management (IWM) and ingress connection rate limiting features. The driver now gracefully handles write-blocking scenarios and optimizes connection establishment during high-load conditions to maintain application availability. See the IWM or Overload Errors docs for more information.
Changes in Version 4.16.0 (2026/01/07)¶
PyMongo 4.16 brings a number of changes including:
Removed invalid documents from
bson.errors.InvalidDocumenterror messages as doing so may leak sensitive user data. Instead, invalid documents are stored inbson.errors.InvalidDocument.document.PyMongo now requires
dnspython>=2.6.1, sincednspython1.0 is no longer maintained. The minimum version is2.6.1to account for CVE-2023-29483.Removed support for Eventlet. Eventlet is actively being sunset by its maintainers and has compatibility issues with PyMongo’s dnspython dependency.
Use Zstandard support from the standard library for Python 3.14+, and use
backports.zstdfor older versions.Fixed return type annotation for
find_one_and_*methods onAsyncCollectionandCollectionto includeNone.Added support for NumPy 1D-arrays in
bson.binary.BinaryVector.Prevented
ClientEncryptionfrom loading the crypt shared library to fix “MongoCryptError: An existing crypt_shared library is loaded by the application” unless the linked library search path is set.
Changes in Version 4.15.5 (2025/12/02)¶
Version 4.15.5 is a bug fix release.
Fixed a bug that could cause
AutoReconnect("connection pool paused")errors when cursors fetched more documents from the database after SDAM heartbeat failures.
Changes in Version 4.15.4 (2025/10/21)¶
Version 4.15.4 is a bug fix release.
Relaxed the callback type of
with_transaction()to allow the broader Awaitable type rather than only Coroutine objects.Added the missing Python 3.14 trove classifier to the package metadata.
Issues Resolved¶
See the PyMongo 4.15.4 release notes in JIRA for the list of resolved issues in this release.
Changes in Version 4.15.3 (2025/10/07)¶
Version 4.15.3 is a bug fix release.
Fixed a memory leak when raising
bson.errors.InvalidDocumentwith C extensions.Fixed the return type of the
distinct(),distinct(),pymongo.asynchronous.cursor.AsyncCursor.distinct(), andpymongo.asynchronous.cursor.AsyncCursor.distinct()methods.
Issues Resolved¶
See the PyMongo 4.15.3 release notes in JIRA for the list of resolved issues in this release.
Changes in Version 4.15.2 (2025/10/01)¶
Version 4.15.2 is a bug fix release.
Add wheels for Python 3.14 and 3.14t that were missing from 4.15.0 release. Drop the 3.13t wheel.
Issues Resolved¶
See the PyMongo 4.15.2 release notes in JIRA for the list of resolved issues in this release.
Changes in Version 4.15.1 (2025/09/16)¶
Version 4.15.1 is a bug fix release.
Fixed a bug in