Update with array of objects
How do I do an update with an array of object where I update multiple fields in the object. The examples I find are just updating one field in the row.
3 Replies
Do you have a little example to share with https://drizzle.run ?
If you mean updating for each
openingHour
in openingHours
, you need to loop over your array, in a transaction (to be sure that all updates apply, https://orm.drizzle.team/docs/transactions).
If you are using SQLite you can use batch (https://orm.drizzle.team/docs/batch-api)Thanks! That worked!