Node.js/Express

DB - attributes 데이터 한정하기,보안

jm_p_op 2024. 4. 23. 12:04
models.User.findAll({
        attributes:["id"],
        where: {
            id:id
        }
    })
  • attributes를 사용하여 받으면 안되는 정보를 제한할수 있다.
  • DB와의 트래픽 줄이기 가능