Skip to content

abhi11210646/mongoose-sanitize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

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.