0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Fixed what was breaking

This commit is contained in:
Trevor Buckner
2020-01-23 12:17:05 -05:00
parent 474b2552fd
commit 27e7af870a

View File

@@ -38,7 +38,7 @@ const junkBrewQuery = HomebrewModel.find({
/* Search for brews that aren't compressed (missing the compressed text field) */
const uncompressedBrewQuery = HomebrewModel.find({
'textBin' : null
}).limit(50);
}).lean().limit(50).select('_id');
router.get('/admin/cleanup', mw.adminOnly, (req, res)=>{
junkBrewQuery.exec((err, objs)=>{
@@ -68,6 +68,9 @@ router.get('/admin/lookup/:id', mw.adminOnly, (req, res, next)=>{
router.get('/admin/finduncompressed', mw.adminOnly, (req, res)=>{
uncompressedBrewQuery.exec((err, objs)=>{
if(err) return res.status(500).send(err);
console.log(objs);
objs = objs.map((obj)=>{return obj._id});
console.log(objs);
return res.json({ count: objs.length, ids: objs });
});
});