Mongol::Cursor - Object cursor
package Person { use Moose; extends 'Mongol::Base'; has 'name' => ( is => 'ro', isa => 'Str', required => 1, ); has 'age' => ( is => 'ro', isa => 'Int', required => 1, ); __PACKAGE__->meta()->make_immutable(); } my $cursor = Person->find( { age => { '$lt' => 30 } } ); while( ( my $person = $cursor->next() ) ) { printf( "Name: %s\n", $person->name() ); printf( "Age: %d\n", $person->age() ); } my @people = $cursor->all();
my @objects = $cursor->all();
my $bool = $cursor->has_next();
my $object = $cursor->next();
MongoDB::Cursor
MongoDB::QueryResult
To install Mongol, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mongol
CPAN shell
perl -MCPAN -e shell install Mongol
For more information on module installation, please visit the detailed CPAN module installation guide.