An open API service indexing awesome lists of open source software.

https://github.com/abhi11210646/mongoose-sanitize

Mongoose plugin that sanitizes input fields to prevent injection attacks, with options to include or skip specific fields.
https://github.com/abhi11210646/mongoose-sanitize

mongoose sanitizer traverse

Last synced: 12 months ago
JSON representation

Mongoose plugin that sanitizes input fields to prevent injection attacks, with options to include or skip specific fields.

Awesome Lists containing this project

README

          

## Usage

```javascript
const sanitizer = require('mongoose-sanitize');

mongooseSchema.plugin(sanitizer, options); // `options` optional field

```

### Options

```
let options = { skip:[], include:[] }
```
- **Skip** Array indicating which fields should be excluded from being sanitized. If omitted or empty, every field in the document will be sanitized.
- **Include** Array indicating which fields should be included to be sanitized. If omitted or empty, every field in the document will be sanitized.