包含1个以上孩子的days
个节点未被删除。我该如何解决这个问题?
const theRef = event.data.ref;
const collectionRef = theRef.parent.child('days');
return collectionRef;
collectionRef.once('value').then(messagesData => {
if(messagesData.numChildren() > 1) {
let updates = {};
updates['/days'] = null;
return defaultDatabase.ref().update(updates); // 'days' doesn't get removed even if it has more than 1 child (as in the image)!
}
});
数据结构:
答案 0 :(得分:0)
是不是因为你需要在最后一次在collectionref上调用之前返回collectionRef?这样:
def there_is_an_alert_after_seconds(self, seconds):
...