Given the layout
+ activity
+ -K5p_pBXog4kb0SVLXxj
text:\'something\',
when:111
+ thread
+ -K5paF53zm3cuudP9FUQ
id:8,
te
Updating the answer based upon your comment.
You want to listen to /activity/$theid/thread/$threadId
:
Rather than nesting, break out the /thread/$threadId
into it's own location at the root.
{
"threadActivity": {
"$activityId": {
"$threadId" : {
}
}
}
}
Now when a new thread is added you can just listen to /threadActivity/$activityId
:
var ref = new Firebase('https://<my>.firebaseio.com/threadActivity');
var activityRef = ref.child('some-id');
activityRef.on('child_added', function(snap) {
// will update you for every child at the location and each child added
console.log(snap.val());
});