note 116127 added to mongo.tutorial.cursor
| From: | mike at brenden dot com | Date: | Wed, 12 Nov 2014 07:36:01 +0000 |
| Subject: | note 116127 added to mongo.tutorial.cursor | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200874@lists.php.net to get a copy of this message | ||
Instead of running while() or foreach() over a Mongo cursor, get all results from cursor into array:
$curs = $Mdb->tbl->find();
$arrOut = iterator_to_array( $curs, false ); // false uses numeric index.
return $arrOut;
----
Server IP: 72.52.91.14
Probable Submitter: 74.96.181.211
----
Manual Page -- http://php.net/manual/en/mongo.tutorial.cursor.php
Edit -- https://master.php.net/note/edit/116127
Del: integrated -- https://master.php.net/note/delete/116127/integrated
Del: useless -- https://master.php.net/note/delete/116127/useless
Del: bad code -- https://master.php.net/note/delete/116127/bad+code
Del: spam -- https://master.php.net/note/delete/116127/spam
Del: non-english -- https://master.php.net/note/delete/116127/non-english
Del: in docs -- https://master.php.net/note/delete/116127/in+docs
Del: other reasons-- https://master.php.net/note/delete/116127
Reject -- https://master.php.net/note/reject/116127
Search -- https://master.php.net/manage/user-notes.php