-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Firebase.push failed: first argument contains an invalid key ($key) #790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@renansuzin This should be addressed by #787. See #197 for a workaround, and #302 for more context / details. As a side note, nesting a list of https://firebase.google.com/docs/database/web/structure-data#avoid_nesting_data |
Thanks for response, in this case a need to list all of alunos to user select and save some in the turma, i dont are saving all the alunos in the turma only the selected by user, im using the alunosTurma list to store the selected alunos and when i try to push the alunosTurma to turma i get the error. The data scructure is like this: alunos = all the alunos for the user select |
Fair enough. You may want to consider implementing a lookup collection in Firebase for students belonging to classrooms (e.g. Feel free to ping me on Gitter if you'd like to discuss further! |
Thanks for your help @byrondover, i'm going to watch the video and follow the @davideast instructions to structure the data of my app, i already joined in the gitter group, thanks for invite. |
Version info
Angular: 2.2.1
Firebase: 3.6.5
AngularFire: 2.0.0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Ionic Framework: 2.0.0-rc.5
Ionic Native: 2.2.11
Ionic App Scripts: 1.0.0
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.9.3
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Debug output
Runtime Error
Error in ./FormTurmaPage class FormTurmaPage - caused by: Firebase.push failed: first argument contains an invalid key ($key) in property 'escola1.turmas.alunos:.0'. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"
** Screenshots **
I'm trying to push a array(alunosTurma[]) of objects(aluno) to a new Firebase item(turma). In my code a get all the alunos and store in a firebaseobservablelist, in the alunosTurma list i store some aluno's objects and when a try to push the alunos list from a new Turma object on firebase i get the error.
The text was updated successfully, but these errors were encountered: