How to delete/remove nodes on Firebase

后端 未结 6 1421
悲&欢浪女
悲&欢浪女 2020-12-07 22:27

I\'m using Firebase for a web app. It\'s written in plain Javascript using no external libraries.

I can \"push\" and retrieve data with \'.on(\"child_added\")\', but

6条回答
  •  一个人的身影
    2020-12-07 22:47

    The problem is that you call remove on the root of your Firebase:

    ref = new Firebase("myfirebase.com")
    ref.remove();
    

    This will remove the entire Firebase through the API.

    You'll typically want to remove specific child nodes under it though, which you do with:

    ref.child(key).remove();
    

提交回复
热议问题