MongoDB aggregations group by and count with a join
I have MongoDB model called candidates appliedJobs: [ { job: { type: Schema.ObjectId, ref: "JobPost" }, date:Date }, ], candidate may have multiple records in appliedJobs array. There I refer to the jobPost. jobPost has the companyName, property. companyName: String,…