sequelize “findbyid” is not a function but apparently “findAll” is

后端 未结 3 733
别那么骄傲
别那么骄傲 2021-02-06 20:51

I am getting a very strange problem with sequelize, When I try to call the function findAll it works fine (same for create and destroy), but when I try to call function \"findBy

3条回答
  •  旧巷少年郎
    2021-02-06 21:36

    Directly pass value.

    Question.findByPk(question_id).then(question => {
                return res.status(200).json({
                    question: question
               });
    }).catch(err => {
         console.log(err);
    });
    

提交回复
热议问题