Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FirebaseExtended/firebase-import
Node module for importing large data into Firebase.
https://github.com/FirebaseExtended/firebase-import
Last synced: 3 months ago
JSON representation
Node module for importing large data into Firebase.
- Host: GitHub
- URL: https://github.com/FirebaseExtended/firebase-import
- Owner: FirebaseExtended
- License: mit
- Created: 2013-06-13T23:52:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-06-16T10:04:23.000Z (over 3 years ago)
- Last Synced: 2024-05-18T21:43:59.984Z (6 months ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 368
- Watchers: 56
- Forks: 58
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-firebase - Firebase Import - A utility which helps import large JSON files into the Firebase Realtime Database. (Utilities)
README
# Firebase-Import
Firebase-import is a helper utility for importing large JSON files into your
[Firebase Realtime Database](https://firebase.google.com/docs/database/). It breaks the JSON into smaller
chunks and uploads them individually through the Firebase API.This utility is designed and tested for imports of files up to 400MB.
## Installing
Install the firebase-import module globally:
$ npm install -g firebase-import
or install it locally and add it to your path:
$ npm install firebase-import
$ export PATH=$PATH:`npm bin`## Obtaining Service account file
Using your Google account, login to Firebase console: https://console.firebase.google.com/See Example below
1. Project Settings ->
2. Service Accounts ->
3. Generate new private key![Service Account Image](https://image.ibb.co/cBuuo9/service_account.png)
## Usage
$ firebase-import
Usage: firebase-importOptions:
--database_url Firebase database URL (e.g. https://databaseName.firebaseio.com). [required]
--path Database path (e.g. /products). [required]
--json The JSON file to import. [required]
--merge Write the top-level children without overwriting the whole parent.
--force Don't prompt before overwriting data.
--service_account Path to a JSON file with your service account credentials.## Example
$ firebase-import --database_url https://test.firebaseio-demo.com --path / --json test.json --service_account /path/to/your/service_account.json
All data at https://test.firebaseio-demo.com/ will be overwritten.
Press to proceed, Ctrl-C to abort.Reading /Users/michael/tmp/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 Firebase:
$ firebase-import --database_url https://test.firebaseio-demo.com --path / --json test.json --merge --service_account /path/to/your/service_account.json
Each top-level child in test.json will be written under https://test.firebaseio-demo.com/.
If a child already exists, it will be overwritten.
Press to proceed, Ctrl-C to abort.Reading /Users/michael/tmp/test.json... (may take a minute)
Preparing JSON for import... (may take a minute)
Importing [=================================================] 100% (9431/9431)
Import completed.