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

后端 未结 3 781
别那么骄傲
别那么骄傲 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:52

    With Sequelize v5, findById() was replaced by findByPk(). Replace findById using findByPk and everything should work fine. You can find query doc here

提交回复
热议问题