【发布时间】:2016-05-31 18:33:43
【问题描述】:
我有两个来自一个根的节点,我想在一个请求中删除这两个节点的数据。两个子节点具有相同的密钥。我试过这个:
Firebase firebaseRef = new Firebase(<root_path>);
Map<String, Object> childUpdates = new HashMap<>();
childUpdates.put(<path_to_first_node>, key);
childUpdates.put(<path_to_second_node>, key);
listToRemoveRef.updateChildren(childUpdates, null);
但它只从第一个节点中删除了数据
【问题讨论】:
-
当我重新编译项目时,上面的代码工作了。
-
将 null 传递给 childUpdates.put(
, null);似乎是更合适的答案
标签: android firebase firebase-realtime-database