Poorani
Poorani

Reputation: 81

How to import CSV files into Firebase

I see we can import json files into firebase.

What I would like to know is if there is a way to import CSV files (I have files that could have about 50K or even more records with about 10 columns). Does it even make sense to have such files in firebase ?

Upvotes: 8

Views: 37606

Answers (5)

persec10000
persec10000

Reputation: 1065

Here is the fastest and very comfortable tools to Import your CSV/json to Firestore and export firestore to csv/json.

https://firefoo.app/docs/firestore-export-import/export-csv

Upvotes: 0

Anton Svetlov
Anton Svetlov

Reputation: 21

Here is the fastest way to Import your CSV to Firestore:

  1. Create an account in Jet Admin
  2. Connect Firebase as a DataSource
  3. Import CSV to Firestore

Ref: https://blog.jetadmin.io/how-to-import-csv-to-firestore-database-without-code/

Upvotes: 1

flegare
flegare

Reputation: 704

One trick I used on top of all the one already mentioned is to synchronize a google spreadsheet with firebase.

You create a script that upload directly to firebase db base on row / columns. It worked quite well and can be more visual for fine tuning the raw data compared to csv/json format directly.

Ref: https://www.sohamkamani.com/blog/2017/03/09/sync-data-between-google-sheets-and-firebase/

Upvotes: 3

simopr
simopr

Reputation: 11

I've uploaded many files (tab separated files) (40MB each) into firebase. Here are the steps:

  1. I wrote a Java code to translate TSV into JSON files.
  2. I used firebase-import to upload them. To install just type in cmd:

npm install firebase-import

Upvotes: 1

seblucas
seblucas

Reputation: 863

I can't answer if it make sense to have such files in Firebase, you should answer that.

I also had to upload CSV files to Firebase and I finally transformed my CSV into JSON and used firebase-import to add my Json into Firebase.

there's a lot of CSV to JSON converters (even online ones). You can pick the one you like the most (I personnaly used node-csvtojson).

Upvotes: 5

Related Questions