An open API service indexing awesome lists of open source software.

https://github.com/morellexf13/json-to-firebase

🔥 Import entire collections to your firestore database using JSON files
https://github.com/morellexf13/json-to-firebase

database firebase firestore

Last synced: 2 months ago
JSON representation

🔥 Import entire collections to your firestore database using JSON files

Awesome Lists containing this project

README

          





🔥




JSON to Firebase








Import entire collections to your firestore database using JSON files





## How to use it?

1- Create a **.env** file and add **FIREBASE_DATABASE_URL={YOUR DATABASE URL}**. You can obtain that value here:
https://console.firebase.google.com/u/2/project/{YOUR PROJECT ID}/settings/serviceaccounts/adminsdk

2- On the same page generate a new private key file using the button. Save that file in the root of this project with the name **service_key.json**

3- Make sure to move your json collections to the files folder following the same name as your collection. i.e. users.json and using this sample:

```json
[{
"name": "John Doe",
"email": "john@doe.com"
}]

```

4- Run the following command to install node dependencies

```bash
npm install
```

5- Import your collection to the firestore database using the following command:
```bash
node uploader.js
```