MongoDBx::Class::Cursor(3pm)

MongoDBx::Class::Cursor3pm

A mongodbx::class cursor/iterator object for query results

Usage

        my $cursor = $coll->find({ author => 'Conan Doyle' });
        print "Novels by Arthur Conan Doyle:\n";
        foreach ($cursor->sort({ year => 1 })->all) {
                print $_->title, '( ', $_->year, ")\n";
        }

Version

version 1.030002

Extends

MongoDB::Cursor

Overview

MongoDBx::Class::Cursor extends MongoDB::Cursor. At its basis, it adds automatic document expansion when traversing cursor results.

Attributes

No special attributes are added.

Object methods

Aside from methods provided by MongoDB::Cursor, the following method modifications are performed:

next( [ $do_not_expand ] )

Returns the next document in the cursor, if any. Automatically expands that document to the appropriate class (if '_class' attribute exists, otherwise document is returned as is). If $do_not_expand is true, the document will not be expanded and simply returned as is (i.e. as a hash-ref).

sort( $rules )

Adds a sort to the cursor and returns the cursor itself for chaining. $rules can either be an unordered hash-ref, an ordered Tie::IxHash object, or an ordered array reference such as this:

        $cursor->sort([ date => -1, time => -1, subject => 1 ])

Support

You can find documentation for this module with the perldoc command.

        perldoc MongoDBx::Class::Cursor

You can also look for information at:

•

RT: CPAN's request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MongoDBx::Class>

•

AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/MongoDBx::Class>

•

CPAN Ratings

<http://cpanratings.perl.org/d/MongoDBx::Class>

•

Search CPAN

<http://search.cpan.org/dist/MongoDBx::Class/>

Author

Ido Perlmuter, "<ido at ido50.net>"

Bugs

Please report any bugs or feature requests to "bug-mongodbx-class at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MongoDBx-Class>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

From libmongodbx-class-perl 1.030002-1 in Debian 8 (Jessie). Parsed by carta from the page's man source.