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

Function read_gridfs_file

test/performance/perf_test.py:623–631  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

621
622
623def read_gridfs_file(filename):
624 assert proc_client is not None
625 bucket = GridFSBucket(proc_client.perftest)
626
627 temp = tempfile.TemporaryFile()
628 try:
629 bucket.download_to_stream_by_name(filename, temp)
630 finally:
631 temp.close()
632
633
634class TestJsonMultiImport(PerformanceTest, unittest.TestCase):

Callers

nothing calls this directly

Calls 3

GridFSBucketClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected