Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Mongoose::Cursor(3)   User Contributed Perl Documentation  Mongoose::Cursor(3)

NAME
       Mongoose::Cursor	- a Mongoose wrapper for MongoDB::Cursor

DESCRIPTION
       Extends Mongoose::Cursor.

       Wraps MongoDB::Cursor's "next", "all" and "batch" methods, so that it
       expands a document into a class.

METHODS
       For your	convenience:

   count
       Same as calling count() on the collection. It will allways return the
       total counting of the filter ignoring skip() and	limit().

   each
       Iterates	over a cursor, calling your sub.

	   Person->find->each( sub {
	       my $obj = shift;

	       # do stuff

	       # return	undef to break out
	       return undef if $done;
	   });

   hash_on
       Returns all data	as a HASH indexed by the key sent as first argument.
       Rows with duplicate keys	are ignored.

	   %tracks = $cd->tracks->find->hash_on('track_name');

   hash_array
       Returns all data	as a HASH indexed by the key sent as first argument.
       Hash values are ARRAYREFs with 1	or more	rows.

	   %tracks = $cd->tracks->find->hash_array('track_name');

perl v5.32.1			  2018-10-08		   Mongoose::Cursor(3)

NAME | DESCRIPTION | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Mongoose::Cursor&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help