File tree Expand file tree Collapse file tree
services/registration/src/routes Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments