Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Regex section in criteria
  • Loading branch information
canni committed Dec 2, 2010
1 parent 3db61e1 commit 2b4fc72
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.mkd
Expand Up @@ -358,6 +358,24 @@ Here are a few more examples for using criteria:
~~~

###Regexp / SQL LIKE replacemt

You can use native PHP Mongo driver class MongoRegex, to query:


~~~
[php]
// Create criteria
$criteria = new EMongoCriteria;
// Find all records witch have first name starring on a, b and c, case insensitive search
$criteria->first_name = new MongoRegex('/^[abc].*/i');
$clients = Client::model()->findAll($criteria);
// see phpdoc for MongoRegex class for more examples
~~~


for reference on how to use query array see: http://www.php.net/manual/en/mongocollection.find.php

Expand Down

0 comments on commit 2b4fc72

Please sign in to comment.