I\'m using MongoDB with NodeJS and am wondering if I need to sanitize data before inserting/updating database documents. Its hard to find definite answer and I\'m wondering if t
Yes, you do. For more information check this out; 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))