Can not add property to an object in mongoose function Can not add property to an object in mongoose function mongoose mongoose

Can not add property to an object in mongoose function


That because the result returned from Mongoose is a Mongoose Object instead a plain javascript object. You need to use lean method to get the plain object you can play with.

AccDoc.find({   startup_id: req.startup.startup_id}).lean().exec().then(function(accDocs) {  ...