123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Grid::FSBucket::Stream

Relationships & Source Files
Namespace Children
Classes:
Defined in: lib/mongo/grid/stream.rb,
lib/mongo/grid/stream/read.rb,
lib/mongo/grid/stream/write.rb

Overview

A stream that reads and writes files from/to the ::Mongo::Grid::FSBucket.

Since:

  • 2.1.0

Constant Summary

Instance Method Summary

Instance Method Details

#get(fs, mode, options = {}) ⇒ Stream::Read, Stream::Write

Get a stream for reading/writing files from/to the ::Mongo::Grid::FSBucket.

Examples:

Get a stream.

FSBucket::Stream.get(fs, FSBucket::READ_MODE, options)

Parameters:

  • fs (FSBucket)

    The GridFS bucket object.

  • mode (FSBucket::READ_MODE, FSBucket::WRITE_MODE)

    The stream mode.

  • options (Hash) (defaults to: {})

    The stream options.

Returns:

Since:

  • 2.1.0

[ GitHub ]

  
# File 'lib/mongo/grid/stream.rb', line 61

def get(fs, mode, options = {})
  MODE_MAP[mode].new(fs, options)
end