Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $regexObj = new MongoRegex("/".preg_quote($data['query'],'/')."/i");
- // $cursor = $collection->find(array("awards" => array('$in' => array("gold", "copper"))));
- // { $or : [ { a : 1 } , { b : 2 } ] }
- $query = array(
- '$or' => array(
- 'title' => $regexObj,
- 'desc' => $regexObj
- )
- );
- $collection->find($query);
Add Comment
Please, Sign In to add comment