Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/abhi11210646/mongoose-sanitize
- Owner: abhi11210646
- License: mit
- Created: 2019-05-15T11:32:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T17:07:52.000Z (4 months ago)
- Last Synced: 2024-11-17T14:19:05.856Z (about 1 month ago)
- Topics: mongoose, sanitizer, traverse
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mongoose-sanitize
- Size: 76.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.