Skip to content

Commit b202d1a

Browse files
committed
Update readme for #282
1 parent 0819ef5 commit b202d1a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ Selects documents where values match a specified regular expression.
306306

307307
User::where('name', 'regex', new MongoRegex("/.*doe/i"))->get();
308308

309+
**NOTE:** you can also use the Laravel regexp operations. These are a bit more flexible and will automatically convert your regular expression string to a MongoRegex object.
310+
311+
User::where('name', 'regexp', '/.*doe/i'))->get();
312+
313+
And the inverse:
314+
315+
User::where('name', 'not regexp', '/.*doe/i'))->get();
316+
309317
**Type**
310318

311319
Selects documents if a field is of the specified type. For more information check: http://docs.mongodb.org/manual/reference/operator/query/type/#op._S_type

0 commit comments

Comments
 (0)