GithubHelp home page GithubHelp logo

mongo-data-anonymizer's Introduction

MongoDB Anonymizer

This package allows you to anonymize specified fields in MongoDB collections and copy them to a target database. It is based on the mongodb-anonymizer package by rap2hpoutre.

Installation

You can install the package globally using npm:

npm install -g mongodb-anonymizer

Usage

To use the package, you need to provide the source and target MongoDB URIs, the fields to anonymize, and optionally, the collections to anonymize or ignore, and the batch size. Here is an example:

mongodb-anonymizer --sourceUri "mongodb://localhost:27017/source" --targetUri "mongodb://localhost:27017/target" --fieldList "email,password" --collectionList "users,admins" --ignoreCollections "logs" --batchSize 500

In this example, the email and password fields in the users and admins collections will be anonymized, the logs collection will be ignored, and the batch size for processing documents is set to 500.

Options

Here are the available options:

  • --sourceUri: The MongoDB URI of the source database.
  • --targetUri: The MongoDB URI of the target database.
  • --fieldList: A comma-separated list of fields to anonymize. You can use the + or - modifiers to add or remove fields from the default list respectively. For example, +age will add age to the default fields, and -email will remove email from the default fields.
  • --collectionList: (Optional) A comma-separated list of collections to anonymize. If not provided, all collections will be anonymized.
  • --ignoreCollections: (Optional) A comma-separated list of collections to ignore during the anonymization process.
  • --batchSize: (Optional) The number of documents to process at a time. Defaults to 1000.
  • --copyNonAnonymized: (Optional) If set, non-anonymized collections will be copied as-is to the target database. By default, non-anonymized collections are not copied.

Note

This package does not delete any data from the source database. It creates a copy of the data in the target database with the specified fields anonymized. Please ensure that you have the necessary permissions and storage capacity before using this package.

mongo-data-anonymizer's People

Contributors

vaneavasco avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.