Except for this fairly uninformative answer and another unpopular answer, I can\'t seem to find any resources about sanitizing user input using Mongoose.
There\'s a blog
There is a new tool providing auto control of coming URL and html body data. https://www.npmjs.com/package/content-filter
Also native escape() method might be used for to protect the database.
escape()
Run the code snippet below to see the results.
let a = "{$gt:25}" console.log(a) console.log(escape(a))