# mongo-query-sanitize

> sanitize mongo queries

Latest version **1.0.1** (published 2019-03-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install mongo-query-sanitize
pnpm add mongo-query-sanitize
yarn add mongo-query-sanitize
bun add mongo-query-sanitize
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-03-26 |
| First published | 2019-03-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mohammed Essehemy |
| Maintainers | mohammedessehemy |
| Keywords | mongo, sanitize |

## Links

- npm: https://www.npmjs.com/package/mongo-query-sanitize
- Repository: https://github.com/MohammedEssehemy/mongo-query-sanitize
- Homepage: https://github.com/MohammedEssehemy/mongo-query-sanitize#readme
- Issues: https://github.com/MohammedEssehemy/mongo-query-sanitize/issues
- npm.io page: https://npm.io/package/mongo-query-sanitize

## Dependencies (1)

- [safe-regex](https://npm.io/package/safe-regex.md) ^2.0.2

## Recent versions

- 1.0.1 (latest) — 2019-03-26
- 1.0.0 — 2019-03-21
- 0.0.1 — 2019-03-21

## README

[![Build Status](https://travis-ci.com/MohammedEssehemy/mongo-query-sanitize.svg?branch=master)](https://travis-ci.com/MohammedEssehemy/mongo-query-sanitize)

# 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
```

---
_Source: https://npm.io/package/mongo-query-sanitize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
