📌  相关文章
📜  未处理的拒绝 TypeError: Article.findById is not a function sequelize - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.206000             🧑  作者: Mango

代码示例1
/* With Sequelize v5, findById() was replaced by findByPk(). 
Replace findById using findByPk and everything should work fine. */

// ex: search for known ids
Project.findByPk(123).then(project => {
  // project will be an instance of Project and stores the content of the table entry
  // with id 123. if such an entry is not defined you will get null
})