Skip to content

yalcinsabancelebi/Bulk-Json-Data-to-Firebase-Firestore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

JSON to Firestore

This library allows you to batch and quickly upload your json files to firestore instead of writing them one by one.

Features

  • A protocol which partitions successfully processed and which failed
  • Automatic identification, whether a document should have a supplied name or a randomly generated name

Usage

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.

firebase.initializeApp({
apiKey: "<YOUR APIKEY>",
authDomain: "https://<YOUR PROJECTID>-project.firebaseio.com",
projectId: "<YOUR PROJECTID>"
});

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

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published