0

我需要做类似的事情。谁能帮帮我?

var listRef = new Firebase("https://t3zlg47s3v6.firebaseio-demo.com/some-list");

    for (var i=0 ; i < 3 ; i++){ 
        listRef.push().set({login: "tulio"+i, email: i+"_tulio@hotmail.com", password: "teste"+i});     
    }

    listRef.on("child_added", function(snapshot) {
        if(snapshot.val().login == 'tulio1'){
            listRef.remove(snapshot);   
        }
     });
4

1 回答 1

8

删除不带参数。相反,您应该从快照中获取对数据的引用并调用 remove,如下所示:

snapshot.ref().remove();
于 2013-03-17T00:01:04.680 回答