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

Method __init__

pymongo/operations.py:475–502  ·  view source on GitHub ↗
(
        self,
        filter: Mapping[str, Any],
        doc: Union[Mapping[str, Any], _Pipeline],
        upsert: Optional[bool],
        collation: Optional[_CollationIn],
        array_filters: Optional[list[Mapping[str, Any]]],
        hint: Optional[_IndexKeyHint],
        namespace: Optional[str],
        sort: Optional[Mapping[str, Any]],
    )

Source from the content-addressed store, hash-verified

473 )
474
475 def __init__(
476 self,
477 filter: Mapping[str, Any],
478 doc: Union[Mapping[str, Any], _Pipeline],
479 upsert: Optional[bool],
480 collation: Optional[_CollationIn],
481 array_filters: Optional[list[Mapping[str, Any]]],
482 hint: Optional[_IndexKeyHint],
483 namespace: Optional[str],
484 sort: Optional[Mapping[str, Any]],
485 ):
486 if filter is not None:
487 validate_is_mapping("filter", filter)
488 if upsert is not None:
489 validate_boolean("upsert", upsert)
490 if array_filters is not None:
491 validate_list("array_filters", array_filters)
492 if hint is not None and not isinstance(hint, str):
493 self._hint: Union[str, dict[str, Any], None] = helpers_shared._index_document(hint)
494 else:
495 self._hint = hint
496 self._filter = filter
497 self._doc = doc
498 self._upsert = upsert
499 self._collation = collation
500 self._array_filters = array_filters
501 self._namespace = namespace
502 self._sort = sort
503
504 def __eq__(self, other: object) -> bool:
505 if isinstance(other, type(self)):

Callers

nothing calls this directly

Calls 3

validate_is_mappingFunction · 0.90
validate_booleanFunction · 0.90
validate_listFunction · 0.90

Tested by

no test coverage detected