Dear Friend,I need a customize query criteria for find method. My condition of query is like below :Mysql Query :Select * from students where (state='xx' and city='yy') OR (university='mm' and college='nn').Please provide above query in mongodb. However I tried to write this in Mongo as below :array(
'$or'=>array(
'$and'=>array(
array('state' => array('$in' => array('Delhi','Bihar'))),
array('city' => array('$in' => array('Delhi','Bihar'))),
),
'$and'=>array(
array('university' => array('$in' => array('New Delhi','Patna'))),
array('college' => array('$in' => array('New Delhi','Patna')))
)
)
)But it produces fatal errors :Fatal error: Uncaught exception 'MongoCursorException' with message '$and expression must be a nonempty array' ...............................
Please help me.
RegardsJay--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb