0
我試圖擺脫在更新前鉤sequelize模型中的所有字段及其對應的值,但我想不出我的錯誤sequelizejs beforeValidate得到鍵和值轉換成目標
,{
timestamps: false,
underscored: true,
hooks: {
beforeValidate: function(transaction, options, fn) {
var ObjectToHash = transaction.getDataValue(); // Here I'm trying to get only the fields and their values
makehash(ObjectToHash)
.then(function(res){
transaction.hash = res;
fn(null, transaction)
})
}
}
}
是getDataValue()正確的功能呢?