Performing a ‘like’ match in MongoDB

Posted by & filed under Development.

So looking through the Doctrine ODM docs on Query Building, I didn’t see anything that lent itself to a like query such as that is found in MySQL. There isn’t a like, option, but using Regular Expressions will work just fine for me. $queryBuilder->field(’title’)->equals(new \MongoRegex(’/keyword/i’)); That will perform a case-insensative query for the term ‘keyword‘… Read more »