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

Function validate_is_mapping

pymongo/common.py:536–543  ·  view source on GitHub ↗

Validate the type of method arguments that expect a document.

(option: str, value: Any)

Source from the content-addressed store, hash-verified

534
535
536def validate_is_mapping(option: str, value: Any) -> None:
537 """Validate the type of method arguments that expect a document."""
538 if not isinstance(value, abc.Mapping):
539 raise TypeError(
540 f"{option} must be an instance of dict, bson.son.SON, or "
541 "any other type that inherits from "
542 "collections.Mapping"
543 )
544
545
546def validate_is_document_type(option: str, value: Any) -> None:

Callers 7

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
validate_ok_for_replaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected