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

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -