MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _prepare_to_die

Method _prepare_to_die

pymongo/cursor_shared.py:88–98  ·  view source on GitHub ↗
(self, already_killed: bool)

Source from the content-addressed store, hash-verified

86 return self._address
87
88 def _prepare_to_die(self, already_killed: bool) -> tuple[int, Optional[_CursorAddress]]:
89 self._killed = True
90 if self._id and not already_killed:
91 cursor_id = self._id
92 assert self._address is not None
93 address = _CursorAddress(self._address, self._get_namespace())
94 else:
95 # Skip killCursors.
96 cursor_id = 0
97 address = None
98 return cursor_id, address
99
100 def _die_no_lock(self) -> None:
101 """Closes this cursor without acquiring a lock."""

Callers 3

_die_no_lockMethod · 0.95
_die_lockMethod · 0.80
_die_lockMethod · 0.80

Calls 2

_get_namespaceMethod · 0.95
_CursorAddressClass · 0.90

Tested by

no test coverage detected