
根据您的评论更新答案。
您想听
/activity/$theid/thread/$threadId:
与其嵌套,不如嵌套
/thread/$threadId在根中。
{ "threadActivity": { "$activityId": { "$threadId" : { } } } }现在,当添加新线程时,您可以只听
/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()); });欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)