title: Condition in update with upsert: true
body: <p>I have db structure as;</p>
  
  <pre><code>"name" : "alex"
  "age" : "21"
  "location" : "la"
  
  "name" : "felix"
  "age" : "1"
  "location" : "la"
  </code></pre>
  
  <p>I want to update location field if name and age fields in the database are equal to the values in my query.</p>
  
  <p>So for example if I wrote;</p>
  
  <pre><code>db.collection.update({name: "alex", age: "32"}, {$set: {location: "ny"}} ,{upsert: true}) 
  </code></pre>
  
  <p>it inserts new element as </p>
  
  <pre><code>name: alex
  age: 32
  </code></pre>
  
  <p>However, what I want to do is; update <code>location</code> if <code>name</code> is <code>alex</code> and <code>age</code> is <code>21</code>. Deleting the <code>upsert</code> can be a solution, however, I use for both insert and update, so <code>upsert</code> shouldn't be deleted. </p>
  
  <p>How can I handle this in the node.js side?</p>
  
  <p>Edit: What I'm trying to do is;</p>
  
  <pre><code>db.collection.update({name: "alex", age: "32"}, {$set: {location: "ny"}} ,{upsert: true}) 
  </code></pre>
  
  <p>returns false, because alex is 21 years old. location cannot be set.</p>
  
  <pre><code>db.collection.update({name: "alex", age: "21"}, {$set: {location: "ny"}} ,{upsert: true}) 
  </code></pre>
  
  <p>sets the location. </p>
  
  <pre><code>"name" : "alex"
  "age" : "21"
  "location" : "la"
  </code></pre>
  
  <p>db becomes </p>
  
  <pre><code>"name" : "alex"
  "age" : "21"
  "location" : "ny"
  
  "name" : "felix"
  "age" : "1"
  "location" : "la"
  </code></pre>