1.1.2 • Published 9 years ago

datamcfly-import v1.1.2

Weekly downloads
5
License
BSD
Repository
github
Last release
9 years ago

Datamcfly-Import

Datamcfly-import is a helper utility for importing large JSON files into Data McFly. It breaks the JSON into smaller chunks and uploads them individually through the Data MCFly API.

Installing

Install the datamcfly-import module globally:

$ npm install -g datamcfly-import

or install it locally and add it to your path:

$ npm install datamcfly-import
$ export PATH=$PATH:`npm bin`

Usage

$ datamcfly-import
Usage: datamcfly-import

Options:
  --datamcfly_key, -k          Data McFly API Key.                                                          [required]
  --datamcfly_app, -a          Data McFly App name.                                                         [required]
  --datamcfly_collection, -c   Data McFly collection name.                                                  [required]
  --json, -j                   The JSON file to import.                                                     [required]
  --merge, -m                  Add the records to the collection without overwriting the whole collection.  [boolean]
  --force                      Don't prompt before overwriting data.                                        [boolean]

Example

$ datamcfly-import --datamcfly_key API-KEY --datamcfly-app Test --datamcfly_collection Stuff --json test.json
All data at Test/Stuff will be overwritten.
Press <enter> to proceed, Ctrl-C to abort.

Reading /Users/roger/test.json... (may take a minute)
Preparing JSON for import... (may take a minute)
Importing [=================================================] 100% (9431/9431)
Import completed.

Or an example of merging the contents of test.json with what's already in your collection:

$ datamcfly-import --datamcfly_key API-KEY --datamcfly-app Test --datamcfly_collection Stuff --json test.json --merge
Each document in test.json will be written under Test/Stuff.  If a document already exists, it will be overwritten.
If a record already exists, it will be overwritten.
Press <enter> to proceed, Ctrl-C to abort.

Reading /Users/roger/test.json... (may take a minute)
Preparing JSON for import... (may take a minute)
Importing [=================================================] 100% (9431/9431)
Import completed.