如何停止观看firebase child_add

How to stop watch on firebase child _added

本文关键字:child add firebase 何停止      更新时间:2023-10-17

我根据日期观察新值,因此当日期移动时,我希望解除旧child_aded的绑定,并重新创建一个新的。

firebaseRef.on('child_added', function(childSnapshot, prevChildKey) {
  // code to handle new child.
});

我如何才能取消查看旧裁判的新数据?

对旧引用使用Firebase.off()。