Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Database Migration

Coming from a SQL background, I'm wondering how does one go about doing database migration in firebase?

Assume I have the following data in firebase {dateFrom: 2015-11-11, timeFrom: 09:00} .... and now the front-end client will store and expects data in the form {dateTimeFrom: 2015-011-11T09:00:00-07:00}. How do I update firebase such that all dateFrom: xxxx and timeFrom: yyyy are removed and replaced with dateTimeFrom: xxxxyyyy? Thanks.

like image 581
user3240644 Avatar asked Feb 02 '16 07:02

user3240644


People also ask

Is it possible to migrate from Firebase?

From Firebase, you should be able to export existing data as JSON, and them import into MongoDB with mongoimport . The docs have some create tutorials and example apps to get you started.


1 Answers

You have to create your own script that reads, transform and write it back. You may eider read one node at the time or read the whole DB if it is not big. You may decide to leave the logic to your client when it access to it (if it ever does)

like image 162
Seb Avatar answered Sep 18 '22 12:09

Seb