Arik5
Arik5

Reputation: 37

How to import a Json arrays without overwriting existing objects in the FireBase RealTimeDB

I import a large amount of JSON files to my FireBase DB console with this feature: https://github.com/firebase/firebase-import

It works well when I upload arrays with lots of objects, but if i want to upload a new array object to existing table, it overrides the existing object instead of adding the new one.

I would be happy to find a right way to "Update" the new objects to the existing table with firebase-import or any other tool.

Upvotes: 1

Views: 579

Answers (1)

Rosário P. Fernandes
Rosário P. Fernandes

Reputation: 11326

As pointed out by Jen, you can use the Firebase CLI to update objects in your database. Just use this command:

firebase database:update /path/to/object -d newArray.json

where:

  • /path/to/object - the path of the object that you want to update.
  • newArray.json - the json file containing the array with the new values.

Upvotes: 2

Related Questions