Skip to content

Instantly share code, notes, and snippets.

@bowbahdoe
Last active January 25, 2016 01:03
Show Gist options
  • Select an option

  • Save bowbahdoe/a3ee9befb4750b77f02d to your computer and use it in GitHub Desktop.

Select an option

Save bowbahdoe/a3ee9befb4750b77f02d to your computer and use it in GitHub Desktop.
update_asset = function(old_asset, updated_asset){
for (var property in old_asset) {
if (old_asset.hasOwnProperty(property) {
old_asset[property] = new_asset[property]
}
}
old_asset.save(function(err){
//handle possible error
})
}
...
//then just use like
update_asset(asset,req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment