C
C
cyberlain2017-04-08 18:23:55
JavaScript
cyberlain, 2017-04-08 18:23:55

How to delete nodes in firebase NOT via web interface?

Has anyone worked closely with firebase? I don’t understand how to delete nodes NOT through the web interface, but with the help of client js. Here is an example of how I create a node:

var messagesRef = new Firebase('http://__________.firebaseio.com/');
var item__name = $('#item__name').val();
messagesRef.push({
    item__name: item__name,
})
messagesRef.limit(10).on('child_added', function(snapshot) {
    var message = snapshot.val();
    messagesRef.limit(10).on('child_added', function(snapshot) {
        var message = snapshot.val();
        $('<div class="item"' + message.item__name + '').appendTo($('#items__wrapper'));
    });
});


For good, you need to somehow get the key of the node, write it to the attribute of the created block and delete it, but I don’t even know how to get this key =/

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question