From 5a1c1e4187335ded1e49180d1ef726eedfef4d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20G=C3=B3mez?= Date: Thu, 12 Oct 2023 12:45:44 +0200 Subject: [PATCH] Limit company metrics (#250) (#251) --- src/companies/repositories/company-states.repository.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/companies/repositories/company-states.repository.ts b/src/companies/repositories/company-states.repository.ts index 03fd1569..0d978fba 100644 --- a/src/companies/repositories/company-states.repository.ts +++ b/src/companies/repositories/company-states.repository.ts @@ -116,9 +116,9 @@ export class CompanyStatesRepository { .match({ companyUuid, timestamp: { $gte: sub(new Date(), { years: 1 }) }, - enterpriseToRevenue: { $ne: [NaN, 0] }, - enterpriseToEbitda: { $ne: [NaN, 0] }, - peg: { $ne: [NaN, 0] }, + enterpriseToRevenue: { $ne: NaN, $gt: 0, $exists: true }, + enterpriseToEbitda: { $ne: NaN, $gt: 0, $exists: true }, + peg: { $ne: NaN, $gt: 0, $exists: true }, }) .group({ _id: '$companyUuid',