【发布时间】:2015-12-31 03:17:09
【问题描述】:
sequelize.define("aModel", {
text: DataTypes.TEXT
}, {
instanceMethods: {
getme1: function() {
return this.text.toUpperCase();
}
},
getterMethods: {
getme2: function() {
return this.text.toUpperCase();
}
}
});
InstanceMethods 和 getterMethods 似乎完成了同样的事情,允许访问虚拟键。为什么要使用一个而不是另一个?
【问题讨论】:
标签: orm sequelize.js