| Class | Mongo::Grid::File |
| In: |
lib/mongo/grid/file.rb
lib/mongo/grid/file/info.rb lib/mongo/grid/file/chunk.rb |
| Parent: | Object |
A representation of a file in the database.
@since 2.0.0
@deprecated Please use the ‘stream’ API on a FSBucket instead.
Will be removed in driver version 3.0.
| chunks | [R] | @return [ Array<Chunk> ] chunks The file chunks. |
| info | [R] | @return [ File::Info ] info The file information. |
Initialize the file.
@example Create the file.
Grid::File.new(data, :filename => 'test.txt')
@param [ IO, String, Array<BSON::Document> ] data The file object, file
contents or chunks.
@param [ BSON::Document, Hash ] options The info options.
@option options [ String ] :filename Required name of the file. @option options [ String ] :content_type The content type of the file.
Deprecated, please use the metadata document instead.
@option options [ String ] :metadata Optional file metadata. @option options [ Integer ] :chunk_size Override the default chunk
size.
@option opts [ Array<String> ] :aliases A list of aliases.
Deprecated, please use the metadata document instead.
@since 2.0.0
Check equality of files.
@example Check the equality of files.
file == other
@param [ Object ] other The object to check against.
@return [ true, false ] If the objects are equal.
@since 2.0.0