Skip to content

Instantly share code, notes, and snippets.

@travist
Created July 24, 2023 21:43
Show Gist options
  • Save travist/e421ec83cf108d199305707adf57faca to your computer and use it in GitHub Desktop.
Save travist/e421ec83cf108d199305707adf57faca to your computer and use it in GitHub Desktop.
Mongo - Change ownership to portal base project owner.
db.projects.find({name: 'formio'}).forEach(project => {
db.projects.updateMany({}, {$set: {owner: project.owner}});
db.forms.updateMany({}, {$set: {owner: project.owner}});
db.submissions.updateMany({}, {$set: {owner: project.owner}});
db.actions.updateMany({}, {$set: {owner: project.owner}});
db.tags.updateMany({}, {$set: {owner: project.owner}});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment