Learn what's new in:
What's New in 4.7
Warning
Breaking Changes
PyMongo v4.7 contains breaking changes. For more information, see Version 4.7 Breaking Changes.
The PyMongo v4.7 release includes the following new features:
Added the
Hello.connection_id, CommandStartedEvent.server_connection_id, CommandSucceededEvent.server_connection_id, and CommandFailedEvent.server_connection_id properties.Added support for name suffixes for Key Management Service (KMS) providers for Client-Side Field Level Encryption (CSFLE). This feature requires
pymongocryptv1.9+ andlibmongocryptv1.9+. For more information, see the API documentation for the AutoEncryptionOpts class.Improved the performance of encoding BSON documents to JSON.
The
ClientEncryption.encrypt()andClientEncryption.encrypt_expression()methods now allow thekey_idargument to be passed in as aUUIDObject.Inflating a
RawBSONDocumentobject containing aCodevalue no longer causes an error.Fixed a bug in Python 3.12 where the error message
RuntimeError: can't create new thread at interpreter shutdowncould be written tostderrwhen aMongoClientthread starts as the Python interpreter is shutting down.Fixed a bug where
Int64instances could not always be encoded by orjson. Code like the following example now runs correctly:
import orjson from bson import json_util orjson.dumps({'a': Int64(1)}, default=json_util.default, option=orjson.OPT_PASSTHROUGH_SUBCLASS)