更新时间:2023-10-11 22:48:34
这是一种方式:
const commentList = this.af.database.list('/eComments', {
preserveSnapshot: true,
query: {
orderByChild: 'sid',
equalTo: sid
}
});
commentList.subscribe(snapshots=>{
snapshots.forEach(snapshot => {
snapshot.ref.remove();
});
})
我不是 AngularFire2 专家,所以可能有更简单/更惯用的方法.
I am not an AngularFire2 expert, so there might be easier/more idiomatic ways.