GithubHelp home page GithubHelp logo

parse-mongodb-export's Introduction

Node.js - parse-mongodb-export

Parse JSON file migration tool for Mongolab.

Build Status

Why?

Native Parse.com JSON file export is incompatible with Mongolab import. This utility can help refactor the Parse JSON format to a format which is compatible with Mongolab JSON schemes to help preserve objectId and date formats.

Converts Parse JSON from this:

{ "results": [
	{
        "automaticUser": true,
        "avatar_url": "",
        "createdAt": "2014-01-13T12:11:47.185Z",
        "didBuyCredits": false,
        "isActive": true,
        "objectId": "08Ve1yyCrp",
        "tokens": 2,
        "updatedAt": "2014-01-13T14:52:14.141Z",
        "username": "ChunkyGoat3803"
    },
    ...

To this JSON format which is compatible with Mongolab JSON import:

[
  {
        "automaticUser": true,
        "avatar_url": "",
        "created_at": {
          "$date" : "2014-01-13T12:11:47.185Z"
          },
        "didBuyCredits": false,
        "isActive": true,
        "_id": "08Ve1yyCrp",
        "tokens": 2,
        "updated_at": {
          "$date": "2014-01-13T14:52:14.141Z"
          },
        "username": "ChunkyGoat3803"
    },
    ...
    ]

Installation

npm install parse-mongodb-export

Usage

Convert the JSON exported from Parse using the command:

parse-mongodb-export -f parse.json -o parse-mongolab.json

Then import the resulting JSON into a Mongolab collection using the mongoimport tool:

mongoimport -h ab123456.mongolab.com:12345 -d heroku_12345 -u user -p password -c User --jsonArray --file parse-mongolab.json

API

Usage: index [options]

Options:

-h, --help            output usage information
-V, --version         output the version number
-f, --file [name]     Parse JSON file to convert for export [parse.json]
-o, --out [name]      Output file name for converted JSON [out.json]
-r, --results [name]  Name of Parse results field ["results"]
-v, --verbose         Use verbose mode

parse-mongodb-export's People

Contributors

moflo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.