MongoDBx::Tiny::GridFS - wrapper class of MongoDB::GridFS
$gridfs = MongoDBx::Tiny::GridFS->new( $database->get_gridfs,$fields_name );
# get Mongodb::GridFS $gridfs_raw = $gridfs->gridfs; # get fields name $gridfs_field_name = $gridfs->field;
$gridfs->put('/tmp/foo.txt', {"filename" => 'foo.txt' }); $gridfs->put('/tmp/bar.txt','bar.txt'); $fh = IO::File->new('/tmp/baz.txt','r'); $gridfs->put($fh,'baz.txt');
# MongoDBx::Tiny::GridFS::File $gridfs_file = $gridfs->get({ filename => 'foo.txt' }); $foo_txt = $gridfs_file->slurp; $bar_txt = $gridfs->get('bar.txt')->slurp;
$gridfs->remove({ filename => 'foo.txt' }); $gridfs->remove('bar.txt');
$gridfs->exists_file({ filename => 'foo.txt' }); $gridfs->exists_file('bar.txt');
wrapper class of MongoDB::GridFS::File
$gf = MongoDBx::Tiny::GridFS::File->new( $gridfs->find_one($query), $self->field );
# MongoDB::GridFS::File $gf_raw = $gf->gridfs_file;
# MongoDB::GridFS::File::print $gf->print($fh,$length,$offset);
# MongoDB::GridFS::File::slurp $all = $gf->slurp(); $buf = $gf->slurp($length,$offset);
field name. default is "filename"
MongoDB::GridFS::File attributes
Naoto ISHIKAWA, <toona at seesaa.co.jp>
<toona at seesaa.co.jp>
Copyright 2013 Naoto ISHIKAWA.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MongoDBx::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MongoDBx::Tiny
CPAN shell
perl -MCPAN -e shell install MongoDBx::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.