해쉬태그 검색할 때요
router.get('/:tag', async(req,res,next)=>{
try{
const posts = await db.Post.findAll({
include : [{
model : db.Hashtag,
where : { name: decodeURIComponent(req.params.name)},
},{
model:db.User,
attributes:['id','nickname']
}]
});
res.json(posts)
}catch(e){
console.error(e)
next(e)
}
});
모든 포스트를 불러 들이고 그 다음에 , 해쉬태그는 검색된것만 부르고, 유저는 모든 유저를 불러들이는건가요?
1.
모든 포스트 + 검색된 해쉬태그 + 모든 유저 ?
아니면
검색된 해쉬태그가 where 같이 조건이 되어서,
2.
검색된 해쉬태그만 들어있는 포스트들 + 검색된 해쉬태그 + 검색된 해쉬태그를 갖고잇는 포스트들을 쓴 유저들만
1번인가요? 2번인가요 ?