-1

Why in some cases, the firebase node is created as a string with double quotes "" and in another cases as a string with no quotes.

for example: ----dates | 022022-- | "022022"--

Thanks for the help

Duda Clash
  • 19
  • 2
  • Show us a concrete example. – Alex Mamo Mar 22 '22 at 12:16
  • To get your Firebase structure, use the Firebase console->Export JSON and copy and paste a snippet of your structure. Then include the code you're using to write that Firebase data. – Jay Mar 22 '22 at 17:54
  • i solved the problem simply adding the .trim() method to myString before putr the save command. – Duda Clash Mar 23 '22 at 10:44

1 Answers1

-1

I solved the problem by simply adding the .trim() method to myString before calling the save command. Example:

movimentacoes_ref =  firebaseref
                    .child("movimentacao")
                    .child(id_Usuario)
                    .child(mesAno); // give me a "mesAno" node in firebase.    

and

movimentacoes_ref =  firebaseref
                    .child("movimentacao")
                    .child(id_Usuario)
                    .child(mesAno.trim()); // give me a mesAno node in firebase.       
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Duda Clash
  • 19
  • 2
  • Actually," .child(mesAno.trim())" it seems do not work properly unless we pass a complete " String myNodeName = mesAno.trim() "and after that " .child(myNodename)" to create it. Sorry for that. – Duda Clash Mar 24 '22 at 11:13