I would like to write a query in Doctrine Mongo ODM that searches by regex in two or more fields. In SQL it would look like:
SELECT * FROM user WHERE name LIKE %search% OR surname LIKE %search%;
I can write a query for one field like this:
$qb->field('surname')->equals(new \MongoRegex('/.*'.$this->search.'.*/i'));
but I'm at a loss when i try to search in more fields.
Thanks for any help