Last active
July 4, 2022 13:58
-
-
Save PierreTurnbull/c39df65973d3c6f5027b6d6e50bbc2d2 to your computer and use it in GitHub Desktop.
script mongo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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