bulkUpdate in sequelize orm

Use the bulkCreate to bulkUpdate method.

bulkCreate([...], { updateOnDuplicate: ["name"] })

updateOnDuplicate is an array of fields that will be updated when the primary key (or may be unique key) match the row. Make sure you have at least one unique field (let say id) in your model and in the dataArray both for upsert.

For reference refer here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)