0

im trying to get some values from the database mysql with this sequelize code:

subSector .sync() .then(() => subSector.findAll({ Where: { Enterprise_Evaluation_ID: 2 } })) .then(result => { console.log(result) }) .catch(error => { console.log(error) }) } 

the problem is that sequelize get all values of the table and not only the data of the condition where.

any idea?

we recently change the project of server in AWS (change of elasticbeanstalk to other instance eb)

1
  • The syntax looks ok and I don't think it is caused due to server change. Try other where conditions for testing. Commented Sep 27, 2018 at 3:54

1 Answer 1

2

Only issue I can find is , Where should be lower case like where

subSector.findAll({ Where: { Enterprise_Evaluation_ID: 2 } }) 

Change it to this :

subSector.findAll({ where: { // <--------- HERE Enterprise_Evaluation_ID: 2 // <--------- Also make sure the field name is proper } }) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.