0.0.7 • Published 11 years ago
dwnz-mongo-clean v0.0.7
mongo-clean
Cleans unneeded stuff of mongo entities before sending them out over AJAX.
Installing
npm install dwnz-mongo-clean --saveSetup
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