diff --git a/EMongoCriteria.php b/EMongoCriteria.php index 495b3bc..3d67b8c 100644 --- a/EMongoCriteria.php +++ b/EMongoCriteria.php @@ -149,7 +149,9 @@ public function compare($column, $value = null, $partialMatch = false) { if ($value===null) return $this; $query = array(); - if (preg_match('/^(?:\s*(<>|<=|>=|<|>|=))?(.*)$/', $value, $matches)) { + if(is_array($value)||is_object($value)){ + $query[$column]=array('$in'=>$value); + }elseif(preg_match('/^(?:\s*(<>|<=|>=|<|>|=))?(.*)$/', $value, $matches)) { $value = $matches[2]; $op = $matches[1]; if ($partialMatch===true)