Skip to content

Instantly share code, notes, and snippets.

@PierreTurnbull
Last active July 4, 2022 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PierreTurnbull/c39df65973d3c6f5027b6d6e50bbc2d2 to your computer and use it in GitHub Desktop.
Save PierreTurnbull/c39df65973d3c6f5027b6d6e50bbc2d2 to your computer and use it in GitHub Desktop.
script mongo
use prod;
accounts = db.accounts.find().toArray();
accounts.forEach(account => {
accountId = account._id
account.deactivatedUsecases = account.desactivatedUsecases
db.accounts.updateOne({ _id: accountId }, { $set: account })
db.accounts.updateOne({ _id: accountId }, { $unset: { desactivatedUsecases: "" } })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment