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

Method abort

gridfs/synchronous/grid_file.py:1186–1190  ·  view source on GitHub ↗

Remove all chunks/files that may have been uploaded and close.

(self)

Source from the content-addressed store, hash-verified

1184 object.__setattr__(self, "_ensured_index", True)
1185
1186 def abort(self) -> None:
1187 """Remove all chunks/files that may have been uploaded and close."""
1188 self._coll.chunks.delete_many({"files_id": self._file["_id"]}, session=self._session)
1189 self._coll.files.delete_one({"_id": self._file["_id"]}, session=self._session)
1190 object.__setattr__(self, "_closed", True)
1191
1192 @property
1193 def closed(self) -> bool:

Callers 8

writeMethod · 0.95
_write_asyncMethod · 0.95
test_abortMethod · 0.45
test_abortMethod · 0.45
closeMethod · 0.45

Calls 3

delete_manyMethod · 0.45
delete_oneMethod · 0.45
__setattr__Method · 0.45

Tested by 4

test_abortMethod · 0.36
test_abortMethod · 0.36