200331_TIL

홍영란·2020년 3월 30일
0

Immersive_TIL📓

목록 보기
66/72

200331_TIL



  • 오늘 생긴 에러
  1. sequelize MODULE_NOT_FOUND
    => npm install

  1. AssertionError [ERR_ASSERTION]: Missing where attribute in the options parameter
    --- postman으로 http://localhost:4000/card/hinted에
    patch 요청 시 발생


    => update(values, options)
    update 첫번째 매개변수인 values 주지 않아서 생긴 오류😓
    https://sequelize.readthedocs.io/en/latest/api/model/#updatevalues-options-promisearrayaffectedcount-affectedrows

https://stackoverflow.com/questions/26581715/sequelize-update-does-not-work-anymore-missing-where-attribute-in-the-options
https://sequelize.org/master/class/lib/model.js~Model.html#static-method-update


  1. warning: ignoring ref with broken name refs/...



https://stackoverflow.com/questions/50078137/warning-ignoring-ref-with-broken-name-refs-stash-2

  1. (node:47046) [SEQUELIZE0004] DeprecationWarning: A boolean value was passed to options.operatorsAliases. This is a no-op with v5 and should be removed.

    https://stackoverflow.com/questions/58593200/deprecationwarning-a-boolean-value-was-passed-to-options-operatorsaliases-this
    let values = { marked: "1" }; 
    // "1": true, "0": false
    // (db에는 tinyint(1)로 저장)
    let condition = { where: { id: req.body.id } };
     Card.update(values, condition);





profile
JavaScript를 공부하고 있습니다:)

0개의 댓글