我有这个节点,参考子节点有 randomID。
master: {
123: {
text: "hello world"
},
456: {
text: "hello world 2"
}
}
ref: {
abc: {
123: 1,
456: 1
},
efg: {
456: 1
}
}
我想循环ref和它refToMaster。如何使用 FirebaseIndex 进行查询?
new FirebaseIndex(ref.child(STUCK_HERE), master);
更新
我将节点结构更新为 hiattp 和 kato 提到的内容。
对不起,我不清楚的问题,我重新编辑这个。实际上,我想同时检索ref.abc和ref.efg检索它们的相关主数据,它们是123和456
以下是我尝试过的。
angularFireCollection(ref, function(s) {
s.forEach(function(cs){
//cs.name() - So I can get abc and efg and put in FirebaseIndex
var index = new FirebaseIndex(ref.child(cs.name()), master);
$scope.foos = angularFireCollection(index);
//I stuck here, must be something wrong.
})
})