Method: Mongo::Grid::FSBucket::Stream#get

Defined in:
lib/mongo/grid/stream.rb

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

Get a stream for reading/writing files from/to the 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



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

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