Skip to content

Update multiple instances #1624

Answered by thetutlage
rodolphonetto asked this question in Help
Discussion options

You must be logged in to vote

Why you are using toJSON? The main purpose of toJSON is to serialize the model to a plain Javascript object. Simply loop as follows:

for (const approver of approversToCleanUnity.rows) {
  approver.merge({ unity_id: null })
  await approver.save()
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rodolphonetto
Comment options

Answer selected by thetutlage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants