From 4a0919b922bdf6f9643891804b0cadb0cf39ac31 Mon Sep 17 00:00:00 2001 From: antoineludeau <52679050+antoineludeau@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:39:06 +0200 Subject: [PATCH] Modified stat key names to identify our new system ID --- lib/models/ban.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/ban.cjs b/lib/models/ban.cjs index 718ccc75..cf656a0d 100644 --- a/lib/models/ban.cjs +++ b/lib/models/ban.cjs @@ -29,10 +29,10 @@ async function getStatsOfDistricts(cog = []) { nbAdressesCertifiees: {$sum: '$nbNumerosCertifies'}, nbCommunesCouvertes: {$sum: 1}, populationCouverte: {$sum: '$population'}, - nbCommunesAvecBanId: {$sum: { + nbCommunesIdSocle: {$sum: { $cond: [{$eq: ['$withBanId', true]}, 1, 0] }}, - nbAdressesAvecBanId: {$sum: { + nbAdressesIdSocle: {$sum: { $cond: [{$eq: ['$withBanId', true]}, '$nbNumeros', 0] }} }