// routes.js// Advanced Searchrouter.get('/advanced-search',async(req,res)=>{try{consttitle=req.query.title;// Get the title from the query parameterconstauthor=req.query.author;// Get the author from the query parameterconstgenre=req.query.genre;// Get the genre from the query parameter// Implement your advanced search logic here based on the query parameters// Example: Search books by title, author, and genreconstquery={};if (title) query.title=newRegExp(title,'i');if (author) query.author=newRegExp(author,'i');if (genre) query.genre=newRegExp(genre,'i');constresults=awaitBook.find(query);res.json(results);}catch (err) {console.error(err);res.status(500).json({ error:'Advanced search failed'});}});