My web application sends data in below format
data = {User: [{id:"1",name:"Smith",email:"[email protected]"},{id:"2",name:"Roy",email:"[email protected]"}], Color: "Orange", Shape: "Triangle"}
We need to create an API to insert the above data received into our POSTGRES database table. The table has columns Email, Color and Shape. So based on the sample data above there will be two inserts that will happen
1. Email:[email protected], Color: Orange, Shape: Triangle
2. Email: [email protected], Color: Orange, Shape: Triangle
Please note the data received cannot be modified now. How do we handle this in Express or Postgres and do bulk insert of the records.