Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

mongo-obfusticate

0.1.2 • Public • Published

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

Keywords

none

install

npm i mongo-obfusticate

Downloadsweekly downloads

0

version

0.1.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability