我刚刚开始使用firebase Functions,并且对Node.js环境不熟悉,有人可以告诉您如何遍历子 Node 并获取子值。
最佳答案
看这个例子:
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);
});