Answer the question
In order to leave comments, you need to log in
[SOLVED] How to query with $or in Doctrine MongoDB ODM?
How to do it in mongo: www.mongodb.org/display/DOCS/Advanced+Queries#Adva...
I guess it can't be done (there's nothing in the docs and API). What then to do if such requests are needed? Any ideas are welcome :)
Answer the question
In order to leave comments, you need to log in
found)
/**
* Adds an "or" expression to the current query.
*
* You can create the expression using the expr() method:
*
* $qb = $this->createQueryBuilder('User');
* $qb
* ->addOr($qb->expr()->field('first_name')->equals('Kris'))
* ->addOr($qb->expr()->field('first_name')->equals('Chris'));
*
*/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question