diff --git a/services/web/scripts/validate-data-of-model.js b/services/web/scripts/validate-data-of-model.js index 2d5909ff6d..f3eb789108 100644 --- a/services/web/scripts/validate-data-of-model.js +++ b/services/web/scripts/validate-data-of-model.js @@ -28,11 +28,11 @@ async function main() { (nextBatch = await getNextBatch(collection, query, maxId, projection)) .length ) { + processBatch(nextBatch) + maxId = nextBatch[nextBatch.length - 1]._id processed += nextBatch.length console.error(maxId, processed) - - processBatch(nextBatch) } console.error('done') }