title: PATCH method to MongoDB using Node
body: <p>I want to create a PATCH method for my API but there is something I don't understand. Imagine I have the following document in my <code>MongoDB</code> database:</p>
  
  <pre><code>{
      _id  : ObjectId(1234...),
      name : "bob",
      age  : 30
  }
  </code></pre>
  
  <p>Now I would like to update this document but I don't know what <code>keys</code> my API will receive. So imagine I make a <code>request</code> in order to change the <code>age</code> but also add a <code>last_name</code>.</p>
  
  <p>The request result would be like this:</p>
  
  <pre><code>{
      _id  : ObjectId(1234...),
      name : "bob",
      last_name : "smith",
      age  : 44
  }
  </code></pre>
  
  <p>The main problem here is that I don't know the arguments I will receive.</p>
  
  <p>My goal is to update the values of the existing keys and <strong>add the keys that are not in the document.</strong> </p>
  
  <p>Any idea?</p>
  
  <p>Thanks</p>