2
votes

Currently, to import bulk data to firebase, we have to go to our firebase console browse for json file and import it in. e.g. of import button

However, I want to import it without going in to the console. That is, my system (web app) will allow admin to override all data in database with a default JSON file.

I don't think the Firebase API (https://www.firebase.com/docs/web/guide/saving-data.html) provide such feature. Any recommendations?

1
did you find a solution? - user924

1 Answers

2
votes

Create a reference to the root of your database and simply set the JSON there.

firebase.database().ref().set({
  whatever: 'JSON'
});

This replaces everything that is currently in your database.