인파

You Can Become A

늦게 시작해도 누구든지 노력하면 개발자가 될수 있어요 !

공부한 내용을 정리합니다
Node.js/Sequelize

[ORM] 📚 Sequelize - left join 하는법

Sequelize left join 시퀄라이저에서 include는 기본적으로 inner join 처리이다. 다음 코드를 보자. [Associate 설정] Shop.hasMany(ShopAd, {foreignKey : 'shop_id', as : 'ads'}); ShopAd.belongsTo(Shop, {foreignKey : 'id'}) [ORM] Shop.findAll({ where: {id:shopId}, include: [{ model: ShopAd, as: 'ads', where: { is_valid: 1, is_vertify: 1 } }] }) [SQL 로그] SELECT `Shop`.`id`, `Shop`.`user_id`, `Shop`.`short_name`, `Shop`.`descripti..

category_image
인파_
2021.12.07
(0)