테이블에서 일부 태그 이름을 얻은 다음 각자 다른 하나를 검색 할 필요가 있지만 또는 이와 유사한 방식으로 을 수행 할 수 없습니다. 이 문제를 해결할 다른 방법이 있습니까?복수 쿼리 sequelize
db.archivos.findAll({
attributes: ['nombre','texto','related'],
where: {
nombre: nombre
},
raw: true
}).then(function(archivos){
if(archivos.length != 0){
tags = archivos[0].related.split('/');
cantTags = tags.length;
for(i=0; i < cantTags; i++){
db.tags.findAll({
attributes: ['paginasRelacionadas'],
where: {
nombre: tags[i]
},
raw: true
}).then(function(query){
related += paginasRelacionadas
});
}
}