skip to Main Content

MongoDB Aggregation with Mongoose in Route

Messing around with aggregations in MongoDB in a Node / Express app with Mongoose. Here's the route: router.get("/search", async (req, res) => { let movies; if(req.query.search){ escapeRegex(req.query.search); const regex = new RegExp(escapeRegex(req.query.search), 'gi'); movies = await Movie.aggregate( [ { '$match':…

VIEW QUESTION
Back To Top
Search