无法从sequelize中的select语句中排除关联的字段

我有以下代码(简化):

var group = sequelize.define("group", { id: {type: DataTypes.INTEGER, autoIncrement: false, primaryKey: true}, name: type: DataTypes.STRING, parentId: DataTypes.INTEGER }, { classMethods: { associate: function (models) { group.belongsToMany(models.item, { as:'items', foreignKey: 'group_id', through: models.group_item_tie }); }} }); var group_item_tie = sequelize.define("group_item_tie", {}, {freezeTableName: true}); var item = sequelize.define("item", { spn: { type: DataTypes.INTEGER, autoIncrement: false, primaryKey: true }, }, { classMethods: { associate: function (models) { item.belongsToMany(models.group, { foreignKey: 'spn', through: models.group_item_tie }); }} }); 

当我尝试用关系返回一些logging时,让我们这样说:

 dbcontext.group.findAll({ where: { id: 6 }, include: [{ model: dbcontext.item, as: 'items', attributes: ['spn'] }] }) 

我也从结果表中得到结果group_item_tie

 [{ "id": 6, "name": "abc", "parentId": 5, "createdAt": "2015-05-06T15:54:58.000Z", "updatedAt": "2015-05-06T15:54:58.000Z", "items": [ { "spn": 1, "group_item_tie": { "createdAt": "2015-05-06 15:54:58.000 +00:00", "updatedAt": "2015-05-06 15:54:58.000 +00:00", "group_id": 6, "spn": 1 } }, { "spn": 2, "group_item_tie": { "createdAt": "2015-05-06 15:54:58.000 +00:00", "updatedAt": "2015-05-06 15:54:58.000 +00:00", "group_id": 6, "spn": 2 } }, 

我在生成的SQL查询中看到它。 如何从select语句中排除这些? 我已经尝试了一些其他的东西,但没有成功。

我希望有一些更干净的,然后只是做:

 delete item.group_item_tie; 

我会回答自己,因为这对未来某个人可能是有用的。 所以根据#3664 , #2974和#2975的答案如下(感谢mickhansen ):

 include: [{ model: dbcontext.item, as: 'items', attributes: ['spn'], through: { attributes: [] } }] 

很快它将被logging。