A DSJ
10/31/2021, 5:55 PMawait prisma.Item.updateMany({
data: [...updatedItems],
})
Maybe an identifier ? PK are ID's that are present inside ;y objects, but I don't know how to let prisma see those ID and update the right records (maybe its automatic ?)Maciek K
10/31/2021, 7:15 PMfor(let item of updatedItems) {
await prisma.Item.update({
where: {
id: item.id
}
data: {
field: item.field,
anotherField: item.anotherField
}
})
}
A DSJ
10/31/2021, 7:39 PMRyan
11/01/2021, 7:17 AMupdateMany
and that will update all items with the same data. If you need to update different items with different data, then you need separate update
calls.A DSJ
11/01/2021, 7:31 AM