title: How to update multiple fields of an array object with one request?
body: <pre><code>{
     _id:xxxxstoreid
      store:{
          products:[
              {
                  _id:xxxproductid,
                  name:xxx,
                  img:url,
              }
          ]
      }
  }
  </code></pre>
  
  <p>since i cannot predict the request for update, params may have just name or it may have both.</p>
  
  <p>here is my query,it updates successfully but it removes other fields if they are not present in the params.
  eg:</p>
  
  <pre><code>var params={_id:xxid,name:'xxx',img:'xxx'}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>var params={_id:xxid,name:'xxx'}
  </code></pre>
  
  <p>in this case if params have just name it removes img field and updates.</p>
  
  <pre><code>User.update({'store.products._id':params._id},{$set:{"store.products":params}},callback);
  </code></pre>