mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-16 10:22:42 +00:00
Fix lock count function
This commit is contained in:
@@ -141,19 +141,13 @@ router.get('/admin/stats', mw.adminOnly, async (req, res)=>{
|
|||||||
|
|
||||||
router.get('/admin/lock', mw.adminOnly, async (req, res)=>{
|
router.get('/admin/lock', mw.adminOnly, async (req, res)=>{
|
||||||
try {
|
try {
|
||||||
const countLocksPipeline = [
|
const countLocksQuery = {
|
||||||
{
|
lock : { $exists: true }
|
||||||
$match :
|
};
|
||||||
{
|
const count = await HomebrewModel.countDocuments(countLocksQuery)
|
||||||
lock : true
|
.then((result)=>{
|
||||||
}
|
return result;
|
||||||
},
|
});
|
||||||
{
|
|
||||||
$count :
|
|
||||||
'count'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const count = await HomebrewModel.aggregate(countLocksPipeline);
|
|
||||||
return res.json({
|
return res.json({
|
||||||
count
|
count
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user