This library allows you to batch and quickly upload your json files to firestore instead of writing them one by one.
- A protocol which partitions successfully processed and which failed
- Automatic identification, whether a document should have a supplied name or a randomly generated name
After cloning the repository to your local computer,First of all download node.js and then go to compiler run npm install
and npm install firebase
. Make sure node_modules is included in your source file.
Go to your Google Firebase account and select your project, if you don't have any projects go to https://firebase.google.com/ create an account and create a project. Name your project and continue.
Step 1 - go to firebase UI and settings -> project settings
Step 2 - service account -> firebase admin sdk -> generate new private key.
Step 3 - click on generate key and it will be download
Step 4 - collect in the same place this all files and rename downloaded json file to 'key.json'. its must be like in this picture
Step 5 - go to general -> click web application
Step 6 - give the web project a name then and the parts marked in red are important. Copy these three lines and paste them in the appropriate places within the project. Press continue to console.
Paste the copied sections into the matching sections below.
Lastly, run $ node bulk-json-to-firebase.js demo-data.json add demo-name
Your data in json file will be added to firestore line by line. Also examine the code block to better understand the difference between add and set parameters in the command. When you get any error, you can review here Google Firestore Documentation