3

I want to find value from table with respect to Id passed in api. When using findByID to find one record I am getting below errro.

TypeError: Modelname.findById is not a function

1 Answer 1

2

findById is from old version of Sequelize module. Now they are using findByPk to find single record from table .

example: Book.findByPk(someId)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.