@@ -13,19 +13,45 @@ PyMongo 4.2 brings a number of improvements including:
13
13
changes may be made before the final release. See :ref: `automatic-queryable-client-side-encryption ` for example usage.
14
14
- Provisional (beta) support for :func: `pymongo.timeout ` to apply a single timeout
15
15
to an entire block of pymongo operations.
16
+ - Added the ``timeoutMS `` URI and keyword argument to :class: `~pymongo.mongo_client.MongoClient `.
16
17
- Added the :attr: `pymongo.errors.PyMongoError.timeout ` property which is ``True `` when
17
18
the error was caused by a timeout.
18
- - Added ``check_exists `` option to :meth: `~pymongo.database.Database.create_collection `
19
+ - Added the ``check_exists `` argument to :meth: `~pymongo.database.Database.create_collection `
19
20
that when True (the default) runs an additional ``listCollections `` command to verify that the
20
21
collection does not exist already.
22
+ - Added the following key management APIs to :class: `~pymongo.encryption.ClientEncryption `:
23
+
24
+ - :meth: `~pymongo.encryption.ClientEncryption.get_key `
25
+ - :meth: `~pymongo.encryption.ClientEncryption.get_keys `
26
+ - :meth: `~pymongo.encryption.ClientEncryption.delete_key `
27
+ - :meth: `~pymongo.encryption.ClientEncryption.add_key_alt_name `
28
+ - :meth: `~pymongo.encryption.ClientEncryption.get_key_by_alt_name `
29
+ - :meth: `~pymongo.encryption.ClientEncryption.remove_key_alt_name `
30
+ - :meth: `~pymongo.encryption.ClientEncryption.rewrap_many_data_key `
31
+ - :class: `~pymongo.encryption.RewrapManyDataKeyResult `
32
+
33
+ - Support for the ``crypt_shared `` library to replace ``mongocryptd `` using the new
34
+ ``crypt_shared_lib_path `` and ``crypt_shared_lib_required `` arguments to
35
+ :class: `~pymongo.encryption_options.AutoEncryptionOpts `.
21
36
22
37
Bug fixes
23
38
.........
24
39
25
40
- Fixed a bug where :meth: `~pymongo.collection.Collection.estimated_document_count `
26
41
would fail with a "CommandNotSupportedOnView" error on views (`PYTHON-2885 `_).
27
42
- Fixed a bug where invalid UTF-8 strings could be passed as patterns for :class: `~bson.regex.Regex `
28
- objects (`PYTHON-3048 `_). :func: `bson.encode ` now correctly raises :class: `bson.errors.InvalidStringData `.
43
+ objects. :func: `bson.encode ` now correctly raises :class: `bson.errors.InvalidStringData ` (`PYTHON-3048 `_).
44
+ - Fixed a bug that caused ``AutoReconnect("connection pool paused") `` errors in the child
45
+ process after fork (`PYTHON-3257 `_).
46
+ - Fixed a bug where :meth: `~pymongo.collection.Collection.count_documents ` and
47
+ :meth: `~pymongo.collection.Collection.distinct ` would fail in a transaction with
48
+ ``directConnection=True `` (`PYTHON-3333 `_).
49
+ - GridFS no longer uploads an incomplete files collection document after encountering an
50
+ error in the middle of an upload fork. This results in fewer
51
+ :class: `~gridfs.errors.CorruptGridFile ` errors (`PYTHON-1552 `_).
52
+ - Renamed PyMongo's internal C extension methods to avoid crashing due to name conflicts
53
+ with mpi4py and other shared libraries (`PYTHON-2110 `_).
54
+ - Fixed tight CPU loop for network I/O when using PyOpenSSL (`PYTHON-3187 `_).
29
55
30
56
Unavoidable breaking changes
31
57
............................
@@ -38,6 +64,11 @@ Unavoidable breaking changes
38
64
Users of the Stable API with estimated_document_count are recommended to upgrade
39
65
their server version to 5.0.9+ or set :attr: `pymongo.server_api.ServerApi.strict `
40
66
to ``False `` to avoid encountering errors (`PYTHON-3167 `_).
67
+ - Removed generic typing from :class: `~pymongo.client_session.ClientSession ` to improve
68
+ support for Pyright (`PYTHON-3283 `_).
69
+ - Added ``__all__ `` to the bson, pymongo, and gridfs packages. This could be a breaking
70
+ change for apps that relied on ``from bson import * `` to import APIs not present in
71
+ ``__all__ `` (`PYTHON-3311 `_).
41
72
42
73
.. _count : https://mongodb.com/docs/manual/reference/command/count/
43
74
@@ -50,6 +81,13 @@ in this release.
50
81
.. _PYTHON-3048 : https://jira.mongodb.org/browse/PYTHON-3048
51
82
.. _PYTHON-2885 : https://jira.mongodb.org/browse/PYTHON-2885
52
83
.. _PYTHON-3167 : https://jira.mongodb.org/browse/PYTHON-3167
84
+ .. _PYTHON-3257 : https://jira.mongodb.org/browse/PYTHON-3257
85
+ .. _PYTHON-3333 : https://jira.mongodb.org/browse/PYTHON-3333
86
+ .. _PYTHON-1552 : https://jira.mongodb.org/browse/PYTHON-1552
87
+ .. _PYTHON-2110 : https://jira.mongodb.org/browse/PYTHON-2110
88
+ .. _PYTHON-3283 : https://jira.mongodb.org/browse/PYTHON-3283
89
+ .. _PYTHON-3311 : https://jira.mongodb.org/browse/PYTHON-3311
90
+ .. _PYTHON-3187 : https://jira.mongodb.org/browse/PYTHON-3187
53
91
.. _PyMongo 4.2 release notes in JIRA : https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=33196
54
92
.. _Queryable Encryption : automatic-queryable-client-side-encryption
55
93
0 commit comments