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

可紊 提交于 2020-01-03 04:44:07

问题


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.


回答1:


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.


来源:https://stackoverflow.com/questions/48311271/how-to-import-a-json-arrays-without-overwriting-existing-objects-in-the-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!