Hi,
Let's see if this help:
pre
code
{"fieldName":{"$regex":"wor","$options":"im"}}
/code
/pre
This link should be helpful: http://docs.mongodb.org/manual/refere...
Hi,
Let's see if this help:
pre
code
{"fieldName":{"$regex":"wor","$options":"im"}}
/code
/pre
This link should be helpful: http://docs.mongodb.org/manual/refere...
Hello Igor,
This only works for the first word in the sentence. Meaning, in the example I described above it will not return any rows because 'world' is the second word.
Thanks
Hello! Try pre{"fieldName": {"$regex": "\\bwor.*", "$options":"im"}}/pre
That works great. I was missing the extra \ .
I am assuming that since you use Mongodb, which is compatible with PCRE, one can use any PCRE directives. Am I correct in my assumption?
Yes, you're right.
Thank you and slight correction...
when passing a query parameter the correct format is:
{"fieldName": {"$regex": "\\\\bwor.*", "$options":"im"}}
Thanks
Thanks for sharing ended up using your solution...Works great! Cheers!
Glad it worked for you Joe! You welcome.