Skip to content

Commit 4308f6c

Browse files
committed
Changed compileWhereIn function
MongoDB 2.6.0, no longer accepting bson object in the $in clause. To fix this, the values need to be numerically indexed starting from zero and have consecutive values. Adding array_values fixed this issue. This fix was not tested on a previous MongoDB version.
1 parent 65b5972 commit 4308f6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ protected function compileWhereIn($where)
887887
{
888888
extract($where);
889889

890-
return array($column => array('$in' => $values));
890+
return array($column => array('$in' => array_values($values)));
891891
}
892892

893893
protected function compileWhereNotIn($where)

0 commit comments

Comments
 (0)