I'm trying to get upsert to work and getting no results
I have three variables I'm posting before this script. If I update, I get result, but I want to upsert and am getting no results.
Here is my code:
if(isset($_POST)){
if($array){
$doc = $collection->update(
array(
'$set' => array(
'_id' => new MongoId(),
'organization' => $mysql_org_name,
'purch_code' => $mysql_purch_code,
'contentname' => $mysql_order_item_name,
array('upsert' => true)
)
)
);
}
}