Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

Mongoose Sanitizer Plugin
https://github.com/abhi11210646/mongoose-sanitize

mongoose sanitizer traverse

Last synced: about 1 month ago
JSON representation

Mongoose Sanitizer Plugin

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.