diff --git a/models/pages/randombanner.js b/models/pages/randombanner.js index 33c36290..2fac3213 100644 --- a/models/pages/randombanner.js +++ b/models/pages/randombanner.js @@ -10,6 +10,11 @@ module.exports = async (req, res, next) => { //agregate to get single random item from banners array const board = await Boards.db.aggregate([ + { + '$match': { + '_id': req.query.board + } + }, { '$unwind': '$banners' },