Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 729 Bytes

README.md

File metadata and controls

56 lines (42 loc) · 729 Bytes

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