我要像使用PHP代碼的MongoDB下面的查詢語句:MongoDB的多,並使用PHP代碼
select * from orders where mrn=1234 and status!=cancelled and status!=delivered and status!=draft
我曾嘗試下面的代碼是不工作:
$filterpatient = array("order.patientinfo.mrn" => $reqresult, '$and' => array(
array('order.orderitem.status' => array('$ne' => array('cancelled','delivered')))
));
$cursor = $collection->find($filterpatient)->sort(array('_id'=>-1));