【发布时间】:2017-11-14 05:22:56
【问题描述】:
我想从通过查询查找的实时数据库中删除一个条目,但我得到了 ref 和 key 属性的意外结果。
ref('photos/users/USERID')
.orderByChild('photoname')
.equalTo('photoname i want to look up')
.limitToFirst(1)
.query('once')
.then(snapshot => {
// correct data at 'photos/users/USERID/PHOTOID'
const entry = snapshot.val();
// seems to be the ref to photos/users/USERID'
const ref = snapshot.ref;
// seems to be USERID
const key = snapshot.key
})
为什么这些不是我刚刚找到的条目的参考/键?删除此条目的最佳方法是什么?
【问题讨论】:
标签: javascript firebase firebase-realtime-database