【发布时间】:2018-04-11 18:39:01
【问题描述】:
我有一个名为 person 的表,我希望默认排除一列,
const Person = sequelize.define('person',{
secretColumn: Sequelize.STRING,
//... and other columns
});
我看到 Sequelize 中有一个名为Scope 的功能:
http://docs.sequelizejs.com/manual/tutorial/scopes.html
我试图这样排除;
const Person = sequelize.define('person',{
secretColumn: Sequelize.STRING,
//... and other columns
}, {
defaultScope: {
exclude: ['secretColumn']
}
});
但这不起作用。有没有其他方法可以默认排除一列?
【问题讨论】:
标签: node.js orm sequelize.js