Answer the question
In order to leave comments, you need to log in
How to search through all connected tables?
Orm sequelize
There is a request, it has several tables connected. I need to search all tables and return the found value. At the moment like this:
models.db.employe.findAll({
order: ,
include: [{
model: models.db.categorySubcategory,
include: [{
model: models.db.category
},
{
model: models.db.subCategory
}]
},
{
model: models.db.personRank,
include: [{
model: models.db.person
},
{
model: models.db.rank
}]
},
{
model: models.db.phone,
where:{
phone:{
[Op.substring]: `${request.query.data}`
}
}
},
{
model: models.db.mainPhone,
where:{
mainPhone:{
[Op.substring]: `${request.query.data}`
}
}
}]
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question