Raises:

See Also:

Core docs:

# File 'lib/mongo/gridfs/grid.rb', line 33definitialize(db,fs_name=DEFAULT_FS_NAME)raiseMongoArgumentError,"db must be a Mongo::DB."unlessdb.is_a?(Mongo::DB)@db=db@files=@db["#{fs_name}.files"]@chunks=@db["#{fs_name}.chunks"]@fs_name=fs_name# Ensure indexes only if not connected to slave.unlessdb.connection.slave_ok?@chunks.create_index([['files_id',Mongo::ASCENDING],['n',Mongo::ASCENDING]],:unique=>true)endend

Instance Method Details

- (Boolean) delete(id)

Delete a file from the store.

Note that deleting a GridFS file can result in read errors if another
process is attempting to read a file while it’s being deleted. While
the odds for this kind of race condition are small, it’s important to
be aware of.