Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 524 Bytes

README.md

File metadata and controls

20 lines (13 loc) · 524 Bytes

Build Status

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