Skip to content

Commit bacaf7f

Browse files
authored
PYTHON-3309 Explicit Queryable Encryption doc example needs to utilize index_key_Id (#986)
1 parent 6ed3852 commit bacaf7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/examples/encryption.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,12 @@ using an ``encrypted_fields`` mapping, as demonstrated by the following example:
510510
db = encrypted_client.test
511511

512512
# Create the collection with encrypted fields.
513-
coll = db.create_collection("coll", encrypted_fields=encrypted_fields)
513+
coll = db.create_collection("coll", encryptedFields=encrypted_fields)
514514

515515
# Create and encrypt an indexed and unindexed value.
516516
val = "encrypted indexed value"
517517
unindexed_val = "encrypted unindexed value"
518-
insert_payload_indexed = client_encryption.encrypt(val, Algorithm.INDEXED, indexed_key_id)
518+
insert_payload_indexed = client_encryption.encrypt(val, Algorithm.INDEXED, indexed_key_id, contention_factor=1)
519519
insert_payload_unindexed = client_encryption.encrypt(unindexed_val, Algorithm.UNINDEXED,
520520
unindexed_key_id)
521521

@@ -529,7 +529,7 @@ using an ``encrypted_fields`` mapping, as demonstrated by the following example:
529529
# The value of "data_key_id" must be the same as used to encrypt the values
530530
# above.
531531
find_payload = client_encryption.encrypt(
532-
val, Algorithm.INDEXED, indexed_key_id, query_type=QueryType.EQUALITY
532+
val, Algorithm.INDEXED, indexed_key_id, query_type=QueryType.EQUALITY, contention_factor=1
533533
)
534534

535535
# Find the document we inserted using the encrypted payload.

0 commit comments

Comments
 (0)