diff --git a/doc/changelog.rst b/doc/changelog.rst index 817862914..420c6c6de 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -8,6 +8,8 @@ PyMongo 4.9 brings a number of improvements including: - Added support for MongoDB 8.0. - A new asynchronous API with full asyncio support. +- Add support for :attr:`~pymongo.encryption.Algorithm.RANGE` and deprecate + :attr:`~pymongo.encryption.Algorithm.RANGEPREVIEW`. - pymongocrypt>=1.10 is now required for :ref:`In-Use Encryption` support. Issues Resolved diff --git a/pymongo/asynchronous/encryption.py b/pymongo/asynchronous/encryption.py index 5977a83c4..13f11c326 100644 --- a/pymongo/asynchronous/encryption.py +++ b/pymongo/asynchronous/encryption.py @@ -463,7 +463,14 @@ class Algorithm(str, enum.Enum): RANGE = "Range" """Range. - .. versionadded:: 4.8 + .. versionadded:: 4.9 + """ + RANGEPREVIEW = "RangePreview" + """**DEPRECATED** - RangePreview. + + .. note:: Support for RangePreview is deprecated. Use :attr:`Algorithm.RANGE` instead. + + .. versionadded:: 4.4 """ @@ -477,7 +484,18 @@ class QueryType(str, enum.Enum): """Used to encrypt a value for an equality query.""" RANGE = "range" - """Used to encrypt a value for a range query.""" + """Used to encrypt a value for a range query. + + .. versionadded:: 4.9 + """ + + RANGEPREVIEW = "RangePreview" + """**DEPRECATED** - Used to encrypt a value for a rangePreview query. + + .. note:: Support for RangePreview is deprecated. Use :attr:`QueryType.RANGE` instead. + + .. versionadded:: 4.4 + """ def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions: @@ -847,7 +865,7 @@ class ClientEncryption(Generic[_DocumentType]): :return: The encrypted value, a :class:`~bson.binary.Binary` with subtype 6. - .. versionchanged:: 4.8 + .. versionchanged:: 4.9 Added the `range_opts` parameter. .. versionchanged:: 4.7 @@ -903,7 +921,7 @@ class ClientEncryption(Generic[_DocumentType]): :return: The encrypted expression, a :class:`~bson.RawBSONDocument`. - .. versionchanged:: 4.8 + .. versionchanged:: 4.9 Added the `range_opts` parameter. .. versionchanged:: 4.7 diff --git a/pymongo/synchronous/encryption.py b/pymongo/synchronous/encryption.py index a04087449..909fd12c8 100644 --- a/pymongo/synchronous/encryption.py +++ b/pymongo/synchronous/encryption.py @@ -461,7 +461,14 @@ class Algorithm(str, enum.Enum): RANGE = "Range" """Range. - .. versionadded:: 4.8 + .. versionadded:: 4.9 + """ + RANGEPREVIEW = "RangePreview" + """**DEPRECATED** - RangePreview. + + .. note:: Support for RangePreview is deprecated. Use :attr:`Algorithm.RANGE` instead. + + .. versionadded:: 4.4 """ @@ -475,7 +482,18 @@ class QueryType(str, enum.Enum): """Used to encrypt a value for an equality query.""" RANGE = "range" - """Used to encrypt a value for a range query.""" + """Used to encrypt a value for a range query. + + .. versionadded:: 4.9 + """ + + RANGEPREVIEW = "RangePreview" + """**DEPRECATED** - Used to encrypt a value for a rangePreview query. + + .. note:: Support for RangePreview is deprecated. Use :attr:`QueryType.RANGE` instead. + + .. versionadded:: 4.4 + """ def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions: @@ -845,7 +863,7 @@ class ClientEncryption(Generic[_DocumentType]): :return: The encrypted value, a :class:`~bson.binary.Binary` with subtype 6. - .. versionchanged:: 4.8 + .. versionchanged:: 4.9 Added the `range_opts` parameter. .. versionchanged:: 4.7 @@ -901,7 +919,7 @@ class ClientEncryption(Generic[_DocumentType]): :return: The encrypted expression, a :class:`~bson.RawBSONDocument`. - .. versionchanged:: 4.8 + .. versionchanged:: 4.9 Added the `range_opts` parameter. .. versionchanged:: 4.7