Ste*_*ong 5 node.js firebase google-cloud-functions
我刚开始使用firebase函数,我是node.js环境的新手,有人可以告诉如何遍历子节点并获取子值.
看这个例子:
const parentRef = admin.database().ref("path");
return parentRef.once('value').then(snapshot => {
const updates = {};
snapshot.forEach(function(child) {
updates[child.key] = null;
});
return parentRef.update(updates);
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3851 次 |
| 最近记录: |