Merge pull request #1875 from overleaf/sk-fix-multi-script

Fix the password-removal script, pass the `multi` flag to update

GitOrigin-RevId: 753f0911304cfe02e97e03e2e018a826c176e780
This commit is contained in:
Simon Detheridge 2019-06-17 15:44:54 +01:00 committed by sharelatex
parent 4b0a445337
commit 7e1b4195c5

View file

@ -18,13 +18,18 @@ function main(callback) {
if (!commit) {
return callback()
}
db.users.update(query, { $unset: { hashedPassword: 1 } }, (err, result) => {
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()
})
}
)
})
}