Method: Mongo::Grid::FSBucket#download_to_stream
- Defined in:
- lib/mongo/grid/fs_bucket.rb
#download_to_stream(id, io) ⇒ Object
Downloads the contents of the file specified by id and writes them to the destination io object.
271 272 273 274 275 276 277 |
# File 'lib/mongo/grid/fs_bucket.rb', line 271 def download_to_stream(id, io) open_download_stream(id) do |stream| stream.each do |chunk| io << chunk end end end |