mongodb update multiple fields of the same row using json

i am using node.js mongodb native driver.

Let's say I have a mongodb collection called tasks , each task looks like

{date:'29th jan', desc:'xxx', status:'incomplete'}

from user input I get a JSON object 'newData' of the form

{desc:'yyy',status:'complete'}

the way I am updating my mongodb row with this newData is something like

db.tasks.update({_id:newData.id},{$set:{desc:newData.desc,status:newData.status}})

there are only two fields here, so using $set on each pair in newData is OK, but my question is can I update the row, without having to write $set on each pair in newData, just mentioning newData once. (obviously I will keep the pair keys in newData the same as the ones is mongodb row)

Because the field names match, you can directly use newData in your $set like this:

db.tasks.update({_id:newData.id}, {$set: newData})

However, if you don't validate which fields newData contains, this can add unwanted data to your task doc.