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

Method _drop_helper

pymongo/synchronous/database.py:1256–1275  ·  view source on GitHub ↗
(
        self, name: str, session: Optional[ClientSession] = None, comment: Optional[Any] = None
    )

Source from the content-addressed store, hash-verified

1254 return self._list_collection_names(session, filter, comment, **kwargs)
1255
1256 def _drop_helper(
1257 self, name: str, session: Optional[ClientSession] = None, comment: Optional[Any] = None
1258 ) -> dict[str, Any]:
1259 command = {"drop": name}
1260 if comment is not None:
1261 command["comment"] = comment
1262
1263 def inner(
1264 session: Optional[ClientSession], conn: Connection, _retryable_write: bool
1265 ) -> dict[str, Any]:
1266 return self._command(
1267 conn,
1268 command,
1269 allowable_errors=["ns not found", 26],
1270 write_concern=self._write_concern_for(session),
1271 parse_write_concern_error=True,
1272 session=session,
1273 )
1274
1275 return self.client._retryable_write(False, inner, session, _Op.DROP)
1276
1277 @_csot.apply
1278 def drop_collection(

Callers 1

drop_collectionMethod · 0.95

Calls 1

_retryable_writeMethod · 0.45

Tested by

no test coverage detected