From 1988d0afb52b9b714774cdf58e9995d1f215bb66 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Fri, 4 Sep 2020 14:50:50 +0100 Subject: [PATCH] Update scripts/rearchive-all-docs.js Co-authored-by: Jakob Ackermann --- services/docstore/scripts/rearchive-all-docs.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/services/docstore/scripts/rearchive-all-docs.js b/services/docstore/scripts/rearchive-all-docs.js index 77dfb7cc43..4530a56ce4 100644 --- a/services/docstore/scripts/rearchive-all-docs.js +++ b/services/docstore/scripts/rearchive-all-docs.js @@ -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}`) }