Maybe there is not a definitive answer here but I would like to know where to handle data validation when dealing with express.js and mongoose. Which of the following is the best practice (I currently use a combination and it's starting to feel very clumsy):
- the Model (mongoose)
- the Controller / Route (express)
Some older posts I have read are:
but conflicting answers just add to the confusion. Maybe it simply isn't clear cut, in which case is one a better option?