Mongoose provide access to previous value of property in pre('save')

Mongoose allows you to configure custom setters in which you do the comparison. pre(‘save’) by itself won’t give you what you need, but together:javascript schema.path('name').set(function (newVal) {
相關文章
相關標籤/搜索