Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Unhandled rejection TypeError: Article.findById is not a function sequelize

/* 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
})
 
PREVIOUS NEXT
Tagged: #Unhandled #rejection #function #sequelize
ADD COMMENT
Topic
Name
4+3 =