A small command line tool to update firebase database on firebase from a csv file.
npm install -g csvtofirebase
csvtofirebase <path/to/csv-file> <path/to/private-key-file> "your-database-url.firebaseio.com" <reference in firebase> <key for each csv row>
You can get your private key JSON file by going to Service Accounts tab in your project's settings page.
Let's say we have a csv data file containing users information.
Now we wanna store user's data at the /users
reference in the database.
For each item, we want the key to be userId. So the command that we'll run will be:
csvtofirebase myUsers.csv private.json "your-database-url.firebaseio.com" users memberId
This will save data in the firebase /users
reference like this:
- users
- 10001
- name
- userId
- favColor
- 10002
- name
- userId
- favColor
License
MIT © ateev