Closed chauhanshubham-dev closed 7 years ago
Update method returns Promise<Array<affectedCount, affectedRows>>
You need to use 2nd argument to access returned records.
Please read docs http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-update
What I'm doing? For one of my use-cases I want to update all rows, having a matching field, and return all updated rows.
What's going wrong? The code below, returns only a single updated row, and is actually updating all the required rows. So, the problem seems to be in returningn rows only.
Dialect: postgres Database version: psql (PostgreSQL) 9.6.2 Sequelize version: 4.1.2
Seems to be an issue, that should have been taken care of, but don't know why it's not working for me. Let me know if you require something else.