如何从Firebase数据库节点中检索特定的子节点而不是节点中所有内容的快照? [英] How do I retrieve specific child(s) from a firebase database node instead of the snapshot of everything in the node?
本文介绍了如何从Firebase数据库节点中检索特定的子节点而不是节点中所有内容的快照?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道如何使用下面的引用来获取节点中的所有子节点。
I know how to obtain all the child in the node using the reference below.
var dbRef = firebase.database().ref().child('Node').orderByKey();
dbRef.on('value', snapshot => {
console.log(snapshot)
}
现在我无法弄清楚如何从数据库中获取特定的子元素,如何同时检索 [1001,1004,1005] ?
Now what I can't figure out is how do I obtain only specific child from the database. How do I simultaneously retrieve just [1001,1004,1005]
?
推荐答案
您无法从Firebase数据库获取数据的唯一方法是使用快照
。
You cannot. The only way in which you can get data from a Firebase dababase is using the snapshot
.
希望有帮助。
这篇关于如何从Firebase数据库节点中检索特定的子节点而不是节点中所有内容的快照?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文