mongoose - How to change multiple fields from an object without doing update? (because I need to use the save method, because of pre) -


mongoose:

how update multiple fields of model without using update or manually setting every field?

thanks (:

you can underscore:

var _ = require('underscore');  _.extend(doc, new_data); doc.save(next); 

see api docs more info.


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

PHP Error "Undefined index" -