1. on: {} 키워드를 사용해서 on 조건을 명시해 줄수 있음.(jpa에서 @JoinColums와 비슷..) let list = await this.findAll({ where: where, limit: parseInt(w.limit || 10), offset: parseInt(w.offset || 0), include: [ { model: db.productSupplier, on: { prodId: db.sequelize.where(db.sequelize.col('price.prodId'), '=', db.sequelize.col('productSupplier.prodId')), suplrId: db.sequelize.where(db.sequelize.col('price.suplrId'), '=',..
SELECT t.a, t.a1 AS 'aa.a1', t.a2 AS 'aa.a2', t.b1 AS 'bb.b1', t.b2 AS 'bb.b2' FROM TEST as t; const list = await db.sequelize.query(sql, { nest: true, // type: db.sequelize.QueryTypes.SELECT }); nest: true 결과 { a: 1, aa: { a1: 1, a2: 2 }, bb: { b1: 1, b2: 2 } } sequelize은 dottie 모듈이 적용되어 있다.
1. 설정파일 추가 launch.json { "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach", "processId": "${command:PickProcess}" } ] } 2. pm2로 실행된 프로그램 pid 검색 pm2 pid app 실행하면 pid를 알아낼 수 있다. 3. vscode 디버깅 실행 vscode에서 Attach를 누르면 보이는 프로세스 선택창에서 위 단계에서 알아낸 pid프로세스를 선택하면 된다. 참고: https://medium.com/@ThreePotatoteers/debugging-expressjs-with-pm2-and-vscode-24761d0e72dc