postgresql - How to use prisma updateManyupsert in order to update multiple data with one database query? - Stack Overflow

admin2025-04-30  1

I am using postgresql data with prisma as ORM, I have a table name product and I wanted to use upsert to store data inside it. It will not create data as I am filtering it before using this.

Let's say below is my api payload that I want to upsert.

[     
 {         
   "productId": "1",         
   "productName": "TEST1"     
 },     
 {         
   "productId": "2",         
   "productName": "TEST2"     
 } 
]

let's say I have already data inside it like

id productId productName
1 1111 Cell 2
2 2222 Cell 4
转载请注明原文地址:http://anycun.com/QandA/1746022142a91465.html