Home:ALL Converter>knex update multiple rows in one query

knex update multiple rows in one query

Ask Time:2019-02-23T23:39:37         Author:Jan Kowalski

Json Formatter

Is it possible to update multiple rows with one query? Like in insert i can pass an array of objects and each key refers each column. Is there anything like that for an update query?

I have an array of objects (id, value) and i want to update all the fields that match id from the object with the value from the same object.

Author:Jan Kowalski,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54843216/knex-update-multiple-rows-in-one-query
yy