I do so, then plan to get all collection items:
$this->db->objects->find(function($cursor) {
foreach($cursor->items as $k => $object) {
// do something....
unset($cursor->items[$k]);
}
if (!$cursor->finished) {$cursor->getMore();}
else {
// trigger my ather code there
....
$cursor->destroy();
}
});
But this does not work properly:
PHP Notice: Undefined property: stdClass::$callback in /usr/local/phpdaemon/app-clients/MongoClient.php on line 1128
PHP Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /usr/local/phpdaemon/app-clients/MongoClient.php on line 1128
And only some part of the collection items was fetched.
I do so, then plan to get all collection items: $this->db->objects->find(function($cursor) { foreach($cursor->items as $k => $object) { // do something.... unset($cursor->items[$k]); } if (!$cursor->finished) {$cursor->getMore();} else { // trigger my ather code there .... $cursor->destroy(); } }); But this does not work properly: PHP Notice: Undefined property: stdClass::$callback in /usr/local/phpdaemon/app-clients/MongoClient.php on line 1128 PHP Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /usr/local/phpdaemon/app-clients/MongoClient.php on line 1128 And only some part of the collection items was fetched.