Closed rafaelklaessen closed 7 years ago
Apparently Firebase can't read the Scala class fields. I was only able to make them a little more object oriented.
I don't have a lot of time today. But let's say if I can help you here.
There is a problem of concept with your approach. As far I read and I understood from the documentation there is no need to keep a parallel data structure in your local.
Firebase works with a database reference that stores your data. Any function from the CRUD ( create, read, update, delete) is applied to this database reference.
Read this documentation:
I hope I am not wrong it is also my first time with this, and I also hope that it helps.
I didn't take a look at your code but I am replying just from your comments.
What I mean is that I tried to use the User class for saving users to the database (rather than using .setValue for all the child fields), but that Firebase can't read its fields even though they're public.
Okay, I fixed it! If we use getters instead of just public fields, it does work. Guess it's some Scala->Java thingy.
I've made the user registering OO with getters. However, the notes work a bit different so I don't know about that yet.
Instead of returning like Array[Map[String, Array[String]]]