Setting custom key when pushing new data to firebase database

后端 未结 10 613
野的像风
野的像风 2020-12-13 12:22

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);
         


        
10条回答
  •  没有蜡笔的小新
    2020-12-13 13:13

    As an update to the top answer, the Firebase API has been changed and setValue() does not work anymore. Now you must use the set() function instead:

    ref.child("Victor").set("setting custom key when pushing new data to firebase database");
    

提交回复
热议问题