def upload_from_stream(self, filename, source, chunk_size_bytes=None,
                           metadata=None):
        with self.open_upload_stream(
                filename, chunk_size_bytes, metadata) as gin:
            gin.write(source)

        return gin._id
Uploads a user file to a GridFS bucket.
dataset/ETHPy150Open mongodb/mongo-python-driver/gridfs/__init__.py/GridFSBucket.upload_from_stream