Man Page: mongocollection.parallelcollectionscan
Operating Environment: php
Section: 3
MONGOCOLLECTION.PARALLELCOLLECTIONSCAN(3) 1 MONGOCOLLECTION.PARALLELCOLLECTIONSCAN(3) MongoCollection::parallelCollectionScan - Returns an array of cursors to iterator over a full collection in parallelSYNOPSISpublic array[MongoCommandCursor] MongoCollection::parallelCollectionScan (int $num_cursors)DESCRIPTIONThis method returns an array of a maximum of num_cursors cursors. An iteration over one of the returned cursors results in a partial set of documents for a collection. Iteration over all the returned cursors results in getting every document back from the collection. This method is a wrapper for the parallelCollectionScan MongoDB command.PARAMETERSo $num_cursors - The number of cursors to request from the server. Please note, that the server can return less cursors than you requested.RETURN VALUESReturns an array of MongoCommandCursor objects.EXAMPLESExample #1 MongoCollection.parallelCollectionScan(3) example Returning all documents in a collection by using multiple cursors. <?php $m = new MongoClient; $c = $m->demo->cities; /* Request three cursors */ $cursors = $c->parallelCollectionScan( 3 ); /* Add all the cursors to the MultipleIterator */ $mi = new MultipleIterator( MultipleIterator::MIT_NEED_ANY ); foreach ( $cursors as $cursor ) { $mi->attachIterator( $cursor ); } /* Iterate over all the associated cursors */ foreach ( $mi as $items ) { foreach ( $items as $item ) { if ( $item !== NULL ) { echo $item['name'], " "; } } } ?>SEE ALSOMultipleIterator, MongoCommandCursor, MongoDB::command. PHP Documentation Group MONGOCOLLECTION.PARALLELCOLLECTIONSCAN(3)
| Related Man Pages |
|---|
| cursors(1t) - opensolaris |
| cursors(n) - centos |
| cursors(n) - redhat |
| mongocollection.aggregatecursor(3) - php |
| mongocollection.findone(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| foreach question |
| Progress Report: 1993 Regents v. USL Complaint - Updated |
| Oracle cursors in UNIX shell scripting |