Skip to content

Commit f0e4156

Browse files
committed
add logging
1 parent f5e93c8 commit f0e4156

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

services/registration/src/routes/statistics.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ statisticsRouter.route("/").get(
6060
matchStage.applicationBranch = new mongoose.Types.ObjectId(branchId);
6161
}
6262

63+
console.log("Running aggregation with matchStage:", matchStage);
64+
65+
const found = await ApplicationModel.find(matchStage).limit(3);
66+
console.log("Matched applications:", found.length);
67+
6368
const aggregatedApplications = await ApplicationModel.aggregate([
6469
{
6570
$match: matchStage,
@@ -231,6 +236,8 @@ statisticsRouter.route("/").get(
231236
},
232237
]);
233238

239+
console.log("result", aggregatedApplications);
240+
234241
const aggregatedUsers: any[] = aggregatedApplications[0].users;
235242
const aggregatedApplicationBranches: any[] = aggregatedApplications[0].applicationBranches;
236243
const aggregatedConfirmationBranches: any[] = aggregatedApplications[0].confirmationBranches;

0 commit comments

Comments
 (0)