Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用 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"))));