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

Method __init__

pymongo/operations.py:148–164  ·  view source on GitHub ↗
(
        self,
        filter: Mapping[str, Any],
        collation: Optional[_CollationIn] = None,
        hint: Optional[_IndexKeyHint] = None,
        namespace: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

146 )
147
148 def __init__(
149 self,
150 filter: Mapping[str, Any],
151 collation: Optional[_CollationIn] = None,
152 hint: Optional[_IndexKeyHint] = None,
153 namespace: Optional[str] = None,
154 ) -> None:
155 if filter is not None:
156 validate_is_mapping("filter", filter)
157 if hint is not None and not isinstance(hint, str):
158 self._hint: Union[str, dict[str, Any], None] = helpers_shared._index_document(hint)
159 else:
160 self._hint = hint
161
162 self._filter = filter
163 self._collation = collation
164 self._namespace = namespace
165
166 def __eq__(self, other: Any) -> bool:
167 if type(other) == type(self):

Callers

nothing calls this directly

Calls 1

validate_is_mappingFunction · 0.90

Tested by

no test coverage detected