bulkCreateでできます!
bulkCreateは一括insert用なのですが、updateOnDuplicateを指定することでPrimaryKeyが重複した場合に、指定したカラムのみを更新することが可能です。
this.repo.bulkCreate(records, {
updateOnDuplicate: [
name,
updated_by,
],
});
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 3 years have passed since last update.
bulkCreateでできます!
bulkCreateは一括insert用なのですが、updateOnDuplicateを指定することでPrimaryKeyが重複した場合に、指定したカラムのみを更新することが可能です。
this.repo.bulkCreate(records, {
updateOnDuplicate: [
name,
updated_by,
],
});
Register as a new user and use Qiita more conveniently
Go to list of users who liked