#NEWLINE# def download_to_stream_by_name( self , filename , destination , revision = ( - 1 ) ) : #NEWLINE# #INDENT# 'Write the contents of `filename` (with optional `revision`) to\n        `destination`.\n\n        For example::\n\n          my_db = MongoClient().test\n          fs = GridFSBucket(my_db)\n          # Get file to write to\n          file = open(\'myfile\',\'wb\')\n          fs.download_to_stream_by_name("test_file", file)\n\n        Raises :exc:`~gridfs.errors.NoFile` if no such version of\n        that file exists.\n\n        Raises :exc:`~ValueError` if `filename` is not a string.\n\n        :Parameters:\n          - `filename`: The name of the file to read from.\n          - `destination`: A file-like object that implements :meth:`write`.\n          - `revision` (optional): Which revision (documents with the same\n            filename and different uploadDate) of the file to retrieve.\n            Defaults to -1 (the most recent revision).\n\n        :Note: Revision numbers are defined as follows:\n          0 = the original stored file\n          1 = the first revision\n          2 = the second revision\n          etc...\n          -2 = the second most recent revision\n          -1 = the most recent revision\n        ' #NEWLINE# gout = self . open_download_stream_by_name ( filename , revision ) #NEWLINE# for chunk in gout : #NEWLINE# #INDENT# destination . write ( chunk )