如何在PHP中构建这个mongodb WHERE查询


How to build this mongodb WHERE query in PHP?

我想在PHP中构建一个mongodb查询

SQL:
select * from tbl where a=3 and b=4

我知道PHP中的WHERE语句应该是:

array('$all' => array('a' => 3, 'b' => 4);

,但如何建立这样一个WHERE:

select * from tbl where (a=3 or b=4) and c=5

试试这个

$cursor = $collection->find(array("awards" => array('$in' => array("gold", "copper"))));