I'm currently building a web application using sequelize and typescript. In my database, I have three tables: WfProjectObject
, which is connected to WfProject
, and WfStep
, also linked to WfProject
.
My goal is to include WfStep
when querying WfProject
, but without including WfProjectObject
.
sequelize.models['WfProjectObject'].findOne({
where: {
objectType: "DOC",
objectElem: idDoc
},
include: [
{
model: sequelize.models['WfProject'],
include: [{ sequelize.models['WfStep'] }] //I'm encountering a syntax error here
}
]
})
Is there a way to achieve this? Any help would be greatly appreciated. Thank you.