Trying to loop through the entire updated field that I have and update them dynamically before saving.
Product.findOne({ _id: productNewData['_id'] }, function (err, doc) { for (var key in productNewData) {
I know that Ruby has a submit method like this:
doc.send(key) = productNewData[key]
I think I can check the parameters and use eval . Is there another way?
source share