MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / delete_key

Method delete_key

pymongo/synchronous/encryption.py:1115–1128  ·  view source on GitHub ↗

Delete a key document in the key vault collection that has the given ``key_id``. :param id` (Binary): The UUID of a key a which must be a :class:`~bson.binary.Binary` with subtype 4 ( :attr:`~bson.binary.UUID_SUBTYPE`). :return: The delete result. .

(self, id: Binary)

Source from the content-addressed store, hash-verified

1113 return self._key_vault_coll.find({})
1114
1115 def delete_key(self, id: Binary) -> DeleteResult:
1116 """Delete a key document in the key vault collection that has the given ``key_id``.
1117
1118 :param id` (Binary): The UUID of a key a which must be a
1119 :class:`~bson.binary.Binary` with subtype 4 (
1120 :attr:`~bson.binary.UUID_SUBTYPE`).
1121
1122 :return: The delete result.
1123
1124 .. versionadded:: 4.2
1125 """
1126 self._check_closed()
1127 assert self._key_vault_coll is not None
1128 return self._key_vault_coll.delete_one({"_id": id})
1129
1130 def add_key_alt_name(self, id: Binary, key_alt_name: str) -> Any:
1131 """Add ``key_alt_name`` to the set of alternate names in the key document with UUID ``key_id``.

Calls 2

_check_closedMethod · 0.95
delete_oneMethod · 0.45

Tested by

no test coverage detected