Nice guide on how to filter content based on query parameters. I hereby want to remind everyone to sanitize the query inputs to keep your application secure!
Hello you’r lectures are amazing. Can you make new lectures for design patterns or Postgresql. You guys are really doing the good work. Thanks in advance.
Nice guide on how to filter content based on query parameters.
I hereby want to remind everyone to sanitize the query inputs to keep your application secure!
how to sanitize the query inputs?
Hello you’r lectures are amazing.
Can you make new lectures for design patterns or Postgresql.
You guys are really doing the good work.
Thanks in advance.
thanks for this tutotial. it's help me too much.
❤❤❤
Thanks!!!
i use Number(val) to convert string to num for fail safe approach
What if I want to filter by genre
did you find a way how to do it?
You can add special filter for that f.e request query
localhost:3000/api/v1/movies?genres=Thriller,Action
then in code
const genres = req.query.genres ? req.query.genres.split(',').map(genre => genre.trim())
const genreQuery = genres > 0 ? { genre: { $all: genres } }: {};
const movies = Movie.find(genreQuery)