diff --git a/services/web/scripts/remove_password_fields_from_migrated_users.js b/services/web/scripts/remove_password_fields_from_migrated_users.js index aa2c96caf9..1acbfc3f47 100644 --- a/services/web/scripts/remove_password_fields_from_migrated_users.js +++ b/services/web/scripts/remove_password_fields_from_migrated_users.js @@ -18,13 +18,18 @@ function main(callback) { if (!commit) { return callback() } - db.users.update(query, { $unset: { hashedPassword: 1 } }, (err, result) => { - if (err) { - return callback(err) + db.users.update( + query, + { $unset: { hashedPassword: 1 } }, + { multi: true }, + (err, result) => { + if (err) { + return callback(err) + } + console.log(`>> Updated users: ${JSON.stringify(result)}`) + return callback() } - console.log(`>> Updated users: ${JSON.stringify(result)}`) - return callback() - }) + ) }) }