Skip to content

Commit

Permalink
PYTHON-3818 Create unique key vault index in auto QE example (#1300)
Browse files Browse the repository at this point in the history
(cherry picked from commit fd760c2)
  • Loading branch information
ShaneHarvey committed Jul 10, 2023
1 parent 61dca84 commit 724dee8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/examples/encryption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ as demonstrated by the following example::
)
key_vault = key_vault_client["keyvault"]["datakeys"]
key_vault.drop()
# Ensure that two data keys cannot share the same keyAltName.
key_vault.create_index(
"keyAltNames",
unique=True,
partialFilterExpression={"keyAltNames": {"$exists": True}},
)
key1_id = client_encryption.create_data_key("local", key_alt_names=["firstName"])
key2_id = client_encryption.create_data_key("local", key_alt_names=["lastName"])

Expand Down

0 comments on commit 724dee8

Please sign in to comment.