You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any documentation or info available to use queryInterface.bulkUpdate method?
I'm trying to update several columns using a seeder file. But I cannot get it work, log keeps trowing
Seed file failed with error: val.replace is not a function
I know it should be something with the parameters passed, but looking at the method signature, there is no way I can figure out what params should be passed and how.
This is my code right now:
up : function(queryInterface, Sequelize) {
return queryInterface.bulkUpdate("Catalogo", catalogos, {});
}
You've already read this far into the code, why don't you go ahead and read the rest. As I've said it's not part of the public API, and it cannot be used for what you want to do - Many separate updates in bulk. It can only do a single update (setting the same values) on many rows
Reacted by Scripnic Alexandru and Tom Rogers
Reacted by Affy01, Patrice Harapeti and Kawtar CHOUBARI
Reacted by Colin G, Tom Rogers, James Meng, Brian Ramirez, olivier azevedo, Lynn, Jordan Hale-Clowes, Felipe Torres (fforres) and Kawtar CHOUBARI
I dont understand how pass parameters of function
queryInterface.bulkUpdate(tableName, values, identifier, options, attributes);
I hava a table monitorDevice has fileld like id, monitorSpotId, alarmTypeDeviceSubType, isAvailable;
and I want to update column alarmTypeDeviceSubType, but it not work;
Activity
janmeier commentedon Nov 23, 2016
Bulk update allows you to update a set of rows, matching a where clause (http://docs.sequelizejs.com/en/v3/api/model/#updatevalues-options-promisearrayaffectedcount-affectedrows), i.e. something like
UPDATE foo SET bar = 42 WHERE baz = 50;. It does not support updating multiple rows to different valuesJhovanni commentedon Nov 23, 2016
But that documentation is about update in sequelize object. There is a bulk update with the following signature in queryInterface
bulkUpdate(tableName, values, identifier, options, attributes);How can I use it?
janmeier commentedon Nov 23, 2016
sequelize/lib/model.js
Line 2391 in 50866b8
sequelize/lib/query-interface.js
Line 569 in 50866b8
You've already read this far into the code, why don't you go ahead and read the rest. As I've said it's not part of the public API, and it cannot be used for what you want to do - Many separate updates in bulk. It can only do a single update (setting the same values) on many rows
Jhovanni commentedon Nov 23, 2016
Thank you.
Then I'll make a promise to update each item individually
mmenik commentedon Mar 2, 2017
I dont understand how pass parameters of function
queryInterface.bulkUpdate(tableName, values, identifier, options, attributes);
I need for update a single row (filter by id) in a seeders file, you can show an example?
Thanks
chaoxihailing commentedon Nov 24, 2017
I dont understand how pass parameters of function
queryInterface.bulkUpdate(tableName, values, identifier, options, attributes);
I hava a table monitorDevice has fileld like id, monitorSpotId, alarmTypeDeviceSubType, isAvailable;
and I want to update column alarmTypeDeviceSubType, but it not work;
I write query like below, How can I work
