Update scripts/rearchive-all-docs.js

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
This commit is contained in:
Simon Detheridge 2020-09-04 14:50:50 +01:00 committed by GitHub
parent 0911011624
commit 1988d0afb5

View file

@ -78,12 +78,8 @@ async function rearchiveAllDocs() {
if (!new RegExp('^[0-9a-fA-F]{24}$').test(endId)) {
throw new Error('Invalid end object id')
}
query._id = {
...(query._id || {}),
...{
$lte: ObjectId(endId)
}
}
query._id = query._id || {}
query._id.$lte = ObjectId(endId)
console.log(`Stopping at object ID ${endId}`)
}