Tell me, please, the regular expression for making the rule:
The string does NOT contain СТРОКА1 .
Context: pull documents out of mongo, in one field it should be СТРОКА1 , and in another field СТРОКА1 should not be.
I do something like this:
$q = 'СТРОКА1'; $regex = new \MongoRegex("/.*{$q}|ALL.*/i"); $regex_deny = new \MongoRegex("/[^({$q})]/i"); $documents = $document_manager->getRepository('MyDocument')->findBy(array( 'field1' => $regex, 'field2' => $regex_deny, )); Thank.