【发布时间】:2017-10-12 10:07:55
【问题描述】:
我正在开发一个 ionic 2 应用程序。 我在firebase中有这种数据
我需要的是通过 exams 节点并获得所有分数的总和。 在 firebase 文档中有这样的例子。
var query = firebase.database().ref("users").orderByKey();
query.once("value")
.then(function(snapshot) {
snapshot.forEach(function(childSnapshot) {
// key will be "ada" the first time and "alan" the second time
var key = childSnapshot.key;
// childData will be the actual contents of the child
var childData = childSnapshot.val();
});
});
但我不知道如何在我的情况下使用它。 谁能帮帮我??
谢谢
【问题讨论】:
标签: angular typescript firebase-realtime-database ionic2