Skip to content

Commit

Permalink
monthWiseEnroll changes done !!
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshN187 committed Nov 24, 2023
1 parent b708609 commit 84bec43
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Controller/UtilizationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,21 @@ module.exports.monthWiseEnroll = async function (req, res) {
},
]
: []),
...(req.query.sports
? [
{
$match: {
sports: new mongoose.Types.ObjectId(
req.query.sports
),
},
},
]
: []),
{
$group: {
_id: {
// "$sports",
// sports: "$sports",
month: { $month: "$from" },
year: { $year: "$from" },
},
Expand All @@ -301,6 +312,7 @@ module.exports.monthWiseEnroll = async function (req, res) {

// console.log(result);
res.json({
datas:result.length,
data: result,
rcode: 200,
});
Expand Down

0 comments on commit 84bec43

Please sign in to comment.