RomainVialard / FirebaseApp

Google Apps Script binding for Firebase Realtime Database
Apache License 2.0
117 stars 30 forks source link

Append data to db without overwriting #9

Closed jrob256 closed 6 years ago

jrob256 commented 6 years ago

First, just want to say thanks for all of the hard work on this. It works great.

My only concern is when writing data, I would like to have the option to disable overwriting. A good example is if you have a huge amount of data that will not fit in a Google sheet. The initial push to the realtime db works great but if I delete the information in that sheet and create new data in the sheet. I would like to append it to the db without overwriting. Is this possible?

If there is a work around for this already, I apologize.

JeanRemiDelteil commented 6 years ago

@jrob256 FirebaseApp is a wrapper around the REST api provided by Firebase. We can not change the way their api is working.

I would say that in this case, you can achieve your goal by checking first if data exists or not, or establishing rules that prevent updating existing data (and using normal access, not admin access).

You have to think well about your usage of the Firebase REST API, all the documentation can be found here: https://firebase.google.com/docs/reference/rest/database/