NAME

Mongol::Cursor - Object cursor

SYNOPSIS

        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();

DESCRIPTION

METHODS

all

        my @objects = $cursor->all();

has_next

        my $bool = $cursor->has_next();

next

        my $object = $cursor->next();

SEE ALSO