Skip to content

Commit

Permalink
fix : top5 group by categoryName
Browse files Browse the repository at this point in the history
  • Loading branch information
papicc45 committed Dec 6, 2023
1 parent 7c023ae commit 96136c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/CategoryController.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports.getTop5 = async (req, res)=> {
$match: { temperature: { $gte: temp_min, $lte: temp_max } }
},
{
$group: { categoryName : "$categoryName", count: { $sum: "$count" } }
$group: { _id: "$categoryName", count: { $sum: "$count" } }
},
{
$sort: { count: -1 }
Expand Down

0 comments on commit 96136c8

Please sign in to comment.