title: PHP updating MongoDB sub array
body: <p>I am wanting to update my sub-array in MongoDB
  Here is what the MongoDB Collection looks like</p>
  
  <pre><code>    array (
        '_id' =&gt; new MongoId("510fb81638fc5d2966000000"),
        'items' =&gt; 
        array (
          '0' =&gt; 
          array (
            'id' =&gt; '510bb69538fc5d0c2d000000',
            'quantity' =&gt; '1',
          ),
          '1' =&gt; 
          array (
            'id' =&gt; '510bca8138fc5d6e38000000',
            'quantity' =&gt; '1',
          ),
        ),
        'session' =&gt; '1359964785.85203874781',
        'status' =&gt; 'cart'
  )
  </code></pre>
  
  <p>I created my form to send the following</p>
  
  <p></p>
  
  <p>however when I try to $set it to mongo</p>
  
  <pre><code>$filter =  array('session' =&gt; $_SESSION["redi-Shop"]);
  $data2 = array(
                  '$set' =&gt; array($_POST['items'])
              );
  $options = array("upsert" =&gt; true);
  $collection-&gt;update( $filter, $data2, $options );
  </code></pre>
  
  <p>Nothing seems to update</p>