upsert script is not working
<p>I'm trying to get upsert to work and getting no results</p>

<p>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.</p>

<p>Here is my code:</p>

<pre><code>if(isset($_POST)){
    if($array){
        $doc = $collection-&gt;update(
            array(
                '$set' =&gt; array(
                    '_id' =&gt; new MongoId(),
                    'organization' =&gt; $mysql_org_name,
                    'purch_code' =&gt; $mysql_purch_code,
                    'contentname' =&gt; $mysql_order_item_name,
                    array('upsert' =&gt; true)
                )
            )
        );
    }
}
</code></pre>