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 } } } }