title: PHP mongodb update on nested array with multiple conditions
body: <p>I've thoroughly searched on the internet for this but haven't found a solution.</p>
  
  <p>Problem : I want to update the quantity in this document. Criteria - itemId=126260, accessDays=30</p>
  
  <pre>
  <p>
      `{
          "_id" : ObjectId("547acfa95ca86bec2e000029"),
          "session_id" : "1111",
          "email" : "aasdasda@sdfsd.com",
          "isProcessed" : 0,
          "couponApplied" : "",
          "countryId" : 2,
          "items" : [
                  {
                          "itemId" : 126260,
                          "batchId" : 102970,
                          "accessDays" : null,
                          "quantity" : 2
                  },
                  {
                          "itemId" : 126260,
                          "batchId" : null,
                          "accessDays" : 30,
                          "quantity" : 2
                  }
          ]
      }`
  <p>
  </pre>
  
  <p>I am trying to do this using PHP :</p>
  
  <pre><code>`$condition = array( "session_id"=&gt;'1111', 'items.itemId'=&gt;126260, 'items.accessDays'=&gt;30);
  $new_values = array( '$set' =&gt; array("items.$.quantity" =&gt; 10) );
  
  $cart_coll-&gt;update($condition, $new_values);`
  </code></pre>
  
  <p>But when I run this code, it updates the first nested object instead of the second.</p>
  
  <p>What am I doing wrong here ? Does mongodb not consider multiple conditions in nested objects ?</p>