Recently, I worked with node and mongoose , and I liked it until I had to update the model.
That's what I'm doing:
module.exports.update = (post, cb) -> Post.update _id: post._id, post, (err, data) -> cb(err, data)
So, I thought it would be just like saving a new publication, but it complains with an error:
err: 'Mod on _id not allowed'
I tried removing post._id before passing it to my update method, but it didn’t work, and I couldn’t find good examples of how to do this, except for those that look odd bit, where you first find Post on _id , then update each key manually and save the message again ...
Any suggestions?
source share