I have an existing PHP/MySQL app which I am trying to migrate to AngularJS/Firebase, just as a way to learn these newer technologies.
The app has its own schema of t
Just in case anyone else comes across this question in the future there is a much easier way of doing this.
You can export your MySQL tables to a CSV file using a tool like SQLYog.
Once you have your CSV file you can then convert that to a JSON format using a free online tool like this one: http://www.convertcsv.com/csv-to-json.htm
I just imported 40 tables from MySQL to Firebase in about 15 minutes. Hope that helps someone!
Your JSON is not valid. Change it to this to be valid:
[{"id":"1","word":"cat","wordmeaning":"a mammal species","wordlength":"3"},
{"id":"2","word":"catapult","wordmeaning":"throwing device","wordlength":"8"},
{"id":"3","word":"cart","wordmeaning":"something to carry things in","wordlength":"4"}]
So these are the changes:
You may want to consider not quoting the values of id
and wordlength
, since these properties seem to be numeric.
Edit
These two online tools seem to validate the JSON correctly (or at least in line with what Firebase expects):
The second one also pretty prints the JSON, so that might be a reason to prefer one or the other.