0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Reduce data retrieved for brews with requested reviews

This commit is contained in:
G.Ambatte
2025-04-07 14:39:33 +12:00
parent bd145f17da
commit 1e35e1096f

View File

@@ -248,6 +248,12 @@ router.get('/api/lock/reviews', mw.adminOnly, asyncHandler(async (req, res)=>{
{
'lock.reviewRequested' : { '$exists': 1 }
},
},
{
$project : {
shareId : 1,
title : 1
}
}
];
const reviewDocuments = await HomebrewModel.aggregate(countReviewsPipeline)