sequestrar junte -se a duas tabelas e encontre
table_with_foreign_key.belongsTo(table_linked,{
foreignKey: 'id_row_from_table_with_foreign_key',
as: 'linked'
})
let res = await table_with_foreign_key.findAll({
where:{
'$linked.id$': 1
},
include: {
model: table_linked,
as: 'linked',
}
});
Thibaudkhan