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

Method new_file

test/test_session.py:512–516  ·  view source on GitHub ↗
(session=None)

Source from the content-addressed store, hash-verified

510 fs = GridFS(client.pymongo_test)
511
512 def new_file(session=None):
513 grid_file = fs.new_file(_id=1, filename="f", session=session)
514 # 1 MB, 5 chunks, to test that each chunk is fetched with same lsid.
515 grid_file.write(b"a" * 1048576)
516 grid_file.close()
517
518 def find(session=None):
519 files = fs.find({"_id": 1}, session=session).to_list()

Callers 4

runMethod · 0.45
test_get_last_versionMethod · 0.45
test_file_existsMethod · 0.45
test_md5Method · 0.45

Calls 2

writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected