Skip to content

Commit 07b0932

Browse files
committed
Use iterator_to_array second parameter instead of array_values
1 parent f1ee99e commit 07b0932

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: src/Jenssegers/Mongodb/Builder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function getFresh($columns = array('*'))
153153
if ($this->limit) $cursor->limit($this->limit);
154154

155155
// Return results
156-
return array_values(iterator_to_array($cursor));
156+
return iterator_to_array($cursor, false);
157157
}
158158
}
159159

Diff for: tests/QueryTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function testSubKey()
6464

6565
$users = DB::collection('users')->where('address.country', 'Belgium')->get();
6666
$this->assertEquals(1, count($users));
67+
$this->assertEquals('John Doe', $users[0]['name']);
6768
}
6869

6970
}

0 commit comments

Comments
 (0)