Skip to content

adarshasnah/mongoose-sanitize-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoose-sanitize-json

npm version

This plugin removes the following fields "_id, __v, __t" and published virtuals "id" when the document is converted to json. (Note other virtual fields will also be published)

Installation

$ npm install mongoose-sanitize-json

Usage

var mongoose = require('mongoose');
var sanitizeJSON = require('mongoose-sanitize-json');

var personSchema = mongoose.Schema({    
    name: String,
    age: Number    
});

personSchema.plugin(sanitizeJSON);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published