I am trying to post huge amount of data to my database using sequelize bulkCreate. However, I'm getting back an empty array in the console and nothing was submitted to mysql database. code:
const addPerson = async (req, res) => {
let info = {
name: req.body.name,
age: req.body.age,
location: req.body.location
};
const personalInfo = await Person.bulkCreate(info, { validate: true });
res.status(200).send(personalInfo);
console.log(personalInfo);
};
data coming from postman:
[
{
"id": 150,
"name": "Jim",
"age": "17",
"location": "New York"
},
{
"id": 160,
"name": "Carey",
"businessId": "18",
"vatGroup": "Stockholm"
}
]
response: []