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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user