title: how to update nested object of mongoose document for only provided keys
body: <p>I am going to update some fields of mongoose document according to provided keys.
  For example,
  When we present mongoose document in json. </p>
  
  <pre><code>user: {
    address: {
      city: "city"
      country: "country"
    }
  }
  </code></pre>
  
  <p>And update params is given like this.</p>
  
  <pre><code>address: {
     city: "city_new"
  }
  </code></pre>
  
  <p>when I run the mongoose api like this.</p>
  
  <pre><code>let params = {
     address: {
        city: "city_new"
     }
  }
  User.set(param)
  </code></pre>
  
  <p>It replace whole address object and final result is</p>
  
  <pre><code>user: {
    address: {
      city: "city_new"
    }
  }
  </code></pre>
  
  <p>it just replace address field, but I want to only update city field.
  This is desired result.</p>
  
  <pre><code>user: {
    address: {
      city: "city_new"
      country: "country"
    }
  }
  </code></pre>
  
  <p>How to do this in mongoose?</p>
  
  <p>When nested object has more complex hierarchy, how can we solve this without manually indicate field like <code>address.city.field1.field2. ...</code></p>
  
  <p>Thanks</p>