SailsJS: beforeUpdate (Lifecycle callback), access current values
问题 It's clear how to access the new values, the first argument contains them beforeUpdate: function (values, cb) {....} But how can I access the current values, that are to be replaced? 回答1: In order do access current values you will have to make the call and get the current record. models/user.js beforeCreate: function (values, cb) { User.findOne(this.update.arguments[0].id || this.update.arguments[0]).exec(err, function(originalUser){/*...*/}) } Also check out https://github.com/balderdashy