Skip to content

Commit 3bb1343

Browse files
author
cnagle
committed
Fixed serializaation issue when connecting to Mongodb 3.0
1 parent 3bddd4b commit 3bb1343

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
@@ -224,7 +224,14 @@ public function getFresh($columns = array())
224224
$column = isset($this->columns[0]) ? $this->columns[0] : '_id';
225225

226226
// Execute distinct
227-
$result = $this->collection->distinct($column, $wheres);
227+
if ($wheres)
228+
{
229+
$result = $this->collection->distinct($column, $wheres);
230+
}
231+
else
232+
{
233+
$result = $this->collection->distinct($column);
234+
}
228235

229236
return $result;
230237
}

0 commit comments

Comments
 (0)