We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9b2b85 commit c78dec7Copy full SHA for c78dec7
1 file changed
services/registration/src/routes/statistics.ts
@@ -58,11 +58,14 @@ statisticsRouter.route("/").get(
58
59
const branchFilter: Record<string, any> = {};
60
if (branchId) {
61
- branchFilter.applicationBranch = new mongoose.Types.ObjectId(branchId);
+ branchFilter["applicationBranch._id"] = new mongoose.Types.ObjectId(branchId);
62
}
63
64
- console.log("branchId", branchId);
65
- console.log("branchFilter", branchFilter);
+ const allApps = await ApplicationModel.find(baseMatch);
+ console.log("Apps matching hexathon:", allApps.length);
66
+
67
+ const filteredApps = await ApplicationModel.find({ ...baseMatch, ...branchFilter });
68
+ console.log("Apps with branch filter:", filteredApps.length);
69
70
const aggregatedApplications = await ApplicationModel.aggregate([
71
{
0 commit comments