0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-09 09:22:38 +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 } 'lock.reviewRequested' : { '$exists': 1 }
}, },
},
{
$project : {
shareId : 1,
title : 1
}
} }
]; ];
const reviewDocuments = await HomebrewModel.aggregate(countReviewsPipeline) const reviewDocuments = await HomebrewModel.aggregate(countReviewsPipeline)