I'm trying to create a like/unlike voting system for a post. First I'm using .push
to send a text input to Firebase:
$('.btn').click(function(){
var post = $('.status-box').val();
var id = snapdata;
ref.child("post").push({user: id, text: post});
$('.status-box').val('');
});
For each "like" I want add a value to the post that already exist, the problem is that I don't know how to access the id .push
is generating for each post.