title: Mongo Multiple Update with php
body: <p>What I want to do is update multiple documents with different values in 1 query if possible.</p>
  
  <p>for example my documents may look like:</p>
  
  <p>1:</p>
  
  <pre><code>{
     "key": 123,
     "price": 10,
  
  }
  </code></pre>
  
  <p>2:</p>
  
  <pre><code>{
  
     "key": 1234,
     "price": 15,
  
  }
  </code></pre>
  
  <p>...</p>
  
  <p>Then I have a form to update the price, Maybe I want to change #1 to 15 and #2 to 400 in 1 query etc..</p>
  
  <p>Previously I had done multi updates like so:</p>
  
  <pre><code>$db-&gt;update('items', array('key' -&gt; array('$in' =&gt; $items_to_update)), array('$inc' =&gt; array('price' =&gt; 1))
  </code></pre>
  
  <p>Which worked great for updating multiple documents and setting the field to the same value, but I'm not sure how to update multiple documents and updating the value to different values.</p>