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

Function validate_list_or_mapping

pymongo/common.py:526–533  ·  view source on GitHub ↗

Validates that 'value' is a list or a document.

(option: Any, value: Any)

Source from the content-addressed store, hash-verified

524
525
526def validate_list_or_mapping(option: Any, value: Any) -> None:
527 """Validates that 'value' is a list or a document."""
528 if not isinstance(value, (abc.Mapping, list)):
529 raise TypeError(
530 f"{option} must either be a list or an instance of dict, "
531 "bson.son.SON, or any other type that inherits from "
532 "collections.Mapping"
533 )
534
535
536def validate_is_mapping(option: str, value: Any) -> None:

Callers 1

validate_ok_for_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected