From 63eb646088bd4035a19f62ae8d51b6bb0e2d3fd4 Mon Sep 17 00:00:00 2001 From: "Daigneau, Jeremy T" Date: Thu, 7 May 2026 16:02:42 -0400 Subject: [PATCH] updated GET /cve query to apply hint to lt queries --- src/controller/cve.controller/cve.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controller/cve.controller/cve.controller.js b/src/controller/cve.controller/cve.controller.js index f952329e8..438743691 100644 --- a/src/controller/cve.controller/cve.controller.js +++ b/src/controller/cve.controller/cve.controller.js @@ -113,22 +113,22 @@ async function getFilteredCves (req, res, next) { for (let i = 0; i < timeModified.timeStamp.length; i++) { if (timeModified.dateOperator[i] === 'lt') { if (cnaModified) { - options.hint = { 'cve.containers.cna.providerMetadata.dateUpdated': 1 } query['cve.containers.cna.providerMetadata.dateUpdated'] = {} // Due to this not being the mongo created date object, we need to actually check the "ISO String" version of this _NOT_ the date object that is being created in the middleware query['cve.containers.cna.providerMetadata.dateUpdated'].$lt = timeModifiedLtDateObject.toISOString() } else { query['time.modified'].$lt = timeModified.timeStamp[i] } + options.hint = { 'cve.containers.cna.providerMetadata.dateUpdated': 1 } } else { if (cnaModified) { - options.hint = { 'cve.containers.cna.providerMetadata.dateUpdated': 1 } query['cve.containers.cna.providerMetadata.dateUpdated'] = {} // Due to this not being the mongo created date object, we need to actually check the "ISO String" version of this _NOT_ the date object that is being created in the middleware query['cve.containers.cna.providerMetadata.dateUpdated'].$gt = timeModifiedGtDateObject.toISOString() } else { query['time.modified'].$gt = timeModified.timeStamp[i] } + options.hint = { 'cve.containers.cna.providerMetadata.dateUpdated': 1 } } } }