Skip to content

Commit 850bc18

Browse files
committed
Merge pull request #436 from lennynyktyk/mongo30-distinct
Fixed serialization issue when connecting to MongoDB 3.0
2 parents 6f73633 + 3bb1343 commit 850bc18

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,14 @@ public function getFresh($columns = array())
220220
$column = isset($this->columns[0]) ? $this->columns[0] : '_id';
221221

222222
// Execute distinct
223-
$result = $this->collection->distinct($column, $wheres);
223+
if ($wheres)
224+
{
225+
$result = $this->collection->distinct($column, $wheres);
226+
}
227+
else
228+
{
229+
$result = $this->collection->distinct($column);
230+
}
224231

225232
return $result;
226233
}

0 commit comments

Comments
 (0)