'How to bulk Insert in POSTGRES using Express API

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.



Solution 1:[1]

Can you check if readinessProbe will help in this use case.

Please refer below article which can help.

Promoting Liveness and Readiness as core Spring Boot concepts https://spring.io/blog/2020/03/25/liveness-and-readiness-probes-with-spring-boot

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sridhar