Mongoosejs refresh a document
问题 Suppose I have a document for example: var doc = Model.findOne({name:"name"}); Now if the document gets edited trough another connection the the database, doc doesn't hold the right information. I do need it, so I have to "refresh" or "redownload" it from the database. Is there any way to do this with only the object "doc"? 回答1: Assuming doc contains the document instance to refresh, you can do this to generically refresh it: doc.model(doc.constructor.modelName).findOne({_id: doc._id},