我有一个非规范化数据如下:
- geohash
- w22
- qt4
- vhy
- e1c
- IzjfhqsUhJU_XQSBGTv
- authorid:
- authorname:
- content:
-Izjv10JcaS7fae6dmqb
- authorid:
- authorname:
- content:
- vhz
- erc
-Izjv10JcaS7fae6dmqb
- authorid:
- authorname:
- content:
- z99
- qt4
- abd
- 4g5
-Izjv10JcaS7fae6dmqb
- authorid:
- authorname:
- content:
我想列出authorid, authorname, content
under的所有值geohash/w22/qt4
。但我不提前知道孩子的名字是什么,或者在层次结构中到底有多少人。
在这个浅层枚举子子项的代码应该是什么样的?
var fooRef = new Firebase('firebaseRef/geohash/w22/qt4');
fooRef.on('child_added', function(snapshot) {
//Need help here.
});