mongo-query-sanitize
v1.0.1
Published
sanitize mongo queries
Downloads
488
Readme
Mongo query sanitize
clear mongo query from malicious operators (where) and unsafe regex expressions.
install
npm install mongo-query-sanitize
usage
const { sanitizeMongoQuery } = require('mongo-query-sanitize');
const maliciousQuery = {$where: "sleep(1000)"}; // or unsafe regex
sanitizeMongoQuery(maliciousQuery); // will throw error