@@ -394,7 +394,7 @@ class Algorithm(str, enum.Enum):
394
394
"""
395
395
396
396
397
- class QueryType (enum .IntEnum ):
397
+ class QueryType (str , enum .Enum ):
398
398
"""**(BETA)** An enum that defines the supported values for explicit encryption query_type.
399
399
400
400
.. note:: Support for Queryable Encryption is in beta.
@@ -403,7 +403,7 @@ class QueryType(enum.IntEnum):
403
403
.. versionadded:: 4.2
404
404
"""
405
405
406
- EQUALITY = 1
406
+ EQUALITY = "equality"
407
407
"""Used to encrypt a value for an equality query."""
408
408
409
409
@@ -599,7 +599,7 @@ def encrypt(
599
599
key_id : Optional [Binary ] = None ,
600
600
key_alt_name : Optional [str ] = None ,
601
601
index_key_id : Optional [Binary ] = None ,
602
- query_type : Optional [int ] = None ,
602
+ query_type : Optional [str ] = None ,
603
603
contention_factor : Optional [int ] = None ,
604
604
) -> Binary :
605
605
"""Encrypt a BSON value with a given key and algorithm.
@@ -617,7 +617,7 @@ def encrypt(
617
617
- `key_alt_name`: Identifies a key vault document by 'keyAltName'.
618
618
- `index_key_id`: **(BETA)** The index key id to use for Queryable Encryption. Must be
619
619
a :class:`~bson.binary.Binary` with subtype 4 (:attr:`~bson.binary.UUID_SUBTYPE`).
620
- - `query_type` (int ): **(BETA)** The query type to execute. See
620
+ - `query_type` (str ): **(BETA)** The query type to execute. See
621
621
:class:`QueryType` for valid options.
622
622
- `contention_factor` (int): **(BETA)** The contention factor to use
623
623
when the algorithm is :attr:`Algorithm.INDEXED`.
0 commit comments