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

Class InvalidDocument

bson/errors.py:33–45  ·  view source on GitHub ↗

Raised when trying to create a BSON object from an invalid document.

Source from the content-addressed store, hash-verified

31
32
33class InvalidDocument(BSONError):
34 """Raised when trying to create a BSON object from an invalid document."""
35
36 def __init__(self, message: str, document: Optional[Any] = None) -> None:
37 super().__init__(message)
38 self._document = document
39
40 @property
41 def document(self) -> Any:
42 """The invalid document that caused the error.
43
44 ..versionadded:: 4.16"""
45 return self._document
46
47
48class InvalidId(BSONError):

Callers 5

_make_c_string_checkFunction · 0.90
_make_nameFunction · 0.90
_name_value_to_bsonFunction · 0.90
_element_to_bsonFunction · 0.90
_dict_to_bsonFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected