Skip to content

Commit

Permalink
Merge pull request #436 from lennynyktyk/mongo30-distinct
Browse files Browse the repository at this point in the history
Fixed serialization issue when connecting to MongoDB 3.0
  • Loading branch information
jenssegers committed Mar 2, 2015
2 parents 6f73633 + 3bb1343 commit 850bc18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Jenssegers/Mongodb/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,14 @@ public function getFresh($columns = array())
$column = isset($this->columns[0]) ? $this->columns[0] : '_id';

// Execute distinct
$result = $this->collection->distinct($column, $wheres);
if ($wheres)
{
$result = $this->collection->distinct($column, $wheres);
}
else
{
$result = $this->collection->distinct($column);
}

return $result;
}
Expand Down

0 comments on commit 850bc18

Please sign in to comment.