我正在使用打字稿来制作打字稿。我有三个表格,WfProjectObject
与WfProject
加入,WfStep
加入WfProject
。
我想将WfStep
与WfProject
包括在内,而不是WfProjectObject
sequelize.models['WfProjectObject'].findOne({
where: {
objectType: "DOC",
objectElem: idDoc
},
include: [
{model: sequelize.models['WfProject'],
include :[{sequelize.models['WfStep']}] //Here it dosn't work, I have a syntax error
},
]
})
我该怎么做?谢谢
答案 0 :(得分:0)
您在include中缺少model
键。
include: [{
model: sequelize.models['WfStep']
}]
答案 1 :(得分:0)
sequelize.models ['WfProjectObject']。findOne({
其中:{
objectType: "DOC",
objectElem: idDoc
},
include: [
{model: sequelize.models['WfProject']},
{model:[{sequelize.models['WfStep']},
]
});