Well, I am new to Firebase and I want to have my own keys while pushing new data to database.
Problem:
FireBase.push().setValue(mapped_values);
This gives structure like below:
How can I create my own custom key there? Such as username or something.
Calling push()
will generate a key for you.
If instead you use child()
, you can determine they key/path yourself.
ref.child("Victor").setValue("setting custom key when pushing new data to firebase database");