dwnz-mongo-clean
v0.0.7
Published
Clean mongo entities
Downloads
1
Readme
mongo-clean
Cleans unneeded stuff of mongo entities before sending them out over AJAX.
Installing
npm install dwnz-mongo-clean --save
Setup
var cleaner = require('dwnz-mongo-clean');
Settings
You can supply keys that you want to ignore on an application wide context.
cleaner.addGlobalKey('KeyToIgnore');
Using
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']);
Running Tests
npm test