where句内にPKを追加した後where: { id: ['id']}
、列updateOnDuplicate: ["name"]
に対してレコードの更新を開始しました
const emailCount = await ManageNomineesModel.count({ col: 'email' });
if(emailCount == 0){
await ManageNomineesModel.bulkCreate(allNominees);
res.status(200).json({ message: "Nominees inserted successfully !"});
} else {
await ManageNomineesModel.bulkCreate(allNominees,
{ updateOnDuplicate: ["name"],
where: { id: ['id']}
});
res.status(200).json({ message: "Nominee records updated successfully !"});
}