Skip to content

Commit fd30ec3

Browse files
committed
Fixing reading from the cursor as per https://jira.mongodb.org/browse/PHP-1381
1 parent 9a97fbc commit fd30ec3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Model/Datasource/MongodbSource.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,7 @@ public function read(Model $Model, $query = array(), $recursive = null) {
11651165

11661166
if (is_object($return)) {
11671167
$_return = array();
1168-
while ($return->hasNext()) {
1169-
$mongodata = $return->getNext();
1168+
foreach ($return as $mongodata) {
11701169
if ($this->config['set_string_id'] && !empty($mongodata['_id']) && is_object($mongodata['_id'])) {
11711170
$mongodata['_id'] = $mongodata['_id']->__toString();
11721171
}

0 commit comments

Comments
 (0)