var Model1 = sequelize.define('Model1', {
field1: DataTypes.STRING,
field2: DataTypes.INTEGER,
field3: {
type: DataTypes.VIRTUAL,
include : {model : Model2},
get: function() {
return this.Model2 where : { condition } <-------------
}
}
})
我想获取关联模型的数据,但先过滤并继续使用dataType virtual