mongo-obfusticate

Obfusticate sensitive data stored in MongoDB


License
MIT
Install
npm install mongo-obfusticate@0.1.2

Documentation

mongo-obfusticate Build Status Coverage Status

Obfusticate sensitive data stored in MongoDB using faker or your own functions.

Installation

npm install --save mongo-obfusticate

Usage

var MongoClient = require('mongodb').MongoClient
  , obfusticate = require('mongo-obfusticate')
  , schemas = {
      'user': {
        firstName: 'name.firstName',
        lastName: 'name.lastName',
        phoneNumber: 123
        paymentInfo: {
          'account': 123
        }
      }
    }

MongoClient.connect(dbUrl, function (err, dbConnection) {
  obfusticate(schemas, dbConnection, callback)
})

API

obfusticate(schemas, dbConnection, cb)

Obfusticates all data in the collections denoted by the keys of the schemas object (like the example shown above). dbConnection is an instance of MongoClient.

Any top-level keys that are on the schema but are not already on the items in the collection will be ignored.

Credits

Ben Parnell