Cleans unneeded stuff of mongo entities before sending them out over AJAX.
npm install dwnz-mongo-clean --save
var cleaner = require('dwnz-mongo-clean');
You can supply keys that you want to ignore on an application wide context.
cleaner.addGlobalKey('KeyToIgnore');
var item = {
Name: "Mongo",
AccountKey: "123"
};
var cleanItem = cleaner.clean(item);
You can also specify keys to ignore in specific cleaning cases
var item = {
Name: "Mongo",
AccountKey: "123",
Test: "Test"
};
var cleanItem = cleaner.clean(item, ['Test']);
npm test