Changelog

Changes in Version 4.17.0 (2026/04/20)

PyMongo 4.17 brings a number of changes including:

  • has_key, iterkeys and itervalues in bson.son.SON have been deprecated and will be removed in PyMongo 5.0. These methods were deprecated in favor of the standard dictionary containment operator in and the keys() and values() methods, respectively.

  • Added the bind() and bind() 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.InvalidDocument error messages as doing so may leak sensitive user data. Instead, invalid documents are stored in bson.errors.InvalidDocument.document.

  • PyMongo now requires dnspython>=2.6.1, since dnspython 1.0 is no longer maintained. The minimum version is 2.6.1 to 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.zstd for older versions.

  • Fixed return type annotation for find_one_and_* methods on AsyncCollection and Collection to include None.

  • Added support for NumPy 1D-arrays in bson.binary.BinaryVector.

  • Prevented ClientEncryption from 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.

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