How can I access each element that is affected by Prisma’s updateMany method?
I would like to update the values based on the current value of each record:
// I want to achieve something like that
prisma.user.updateMany((record) => {
// access the current record
const recordID = record.id
// return or update the record
return { data: { encryptedId: encrypt(recordID) }};
};
});
2
Answers
I ended up using this implementation:
check this answer you may use
$transaction
withmap