Skip to content

Commit

Permalink
chore: fixing migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Oct 10, 2023
1 parent 70f2866 commit 3a4ee32
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function migrateAccounts(db, batchSize = 100) {
for (let i = 0; i < batchSize && (await cursor.hasNext()); i++) {
const account = await cursor.next()
batchWalletUpdates.push({
updateOne: {
updateMany: {
filter: { _accountId: account._id },
update: { $set: { accountId: account.id } },
},
Expand All @@ -27,7 +27,7 @@ async function migrateAccounts(db, batchSize = 100) {

if (batchWalletUpdates.length > 0) {
await db.collection("wallets").bulkWrite(batchWalletUpdates)
await db.collection("accountsIp").bulkWrite(accountIpsUpdates)
await db.collection("accountsips").bulkWrite(accountIpsUpdates)
console.log(`Processed ${batchCount} accounts`)
}
}
Expand Down

0 comments on commit 3a4ee32

Please sign in to comment.