📜  m- m sequelize - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:18.283000             🧑  作者: Mango

代码示例1
User.belongsToMany(Bar, { through: UserPubCrawl });
Bar.belongsToMany(User, { through: UserPubCrawl });

User.findAll({
  where: { user_id: '123' },
  include: {
    model: Bars,
    through: { attributes: [] } // this will remove the rows from the join table (i.e. 'UserPubCrawl table') in the result set
  }
});