【发布时间】:2015-10-09 13:42:40
【问题描述】:
在同一 ref.updatChildren() 操作中尝试使用“users/user”和“users/user/name”等路径执行多路径写入时,应用程序崩溃并出现以下异常:
com.firebase.client.FirebaseException:路径 X 是 X/Y 的祖先 更新。
在 Firebase 中执行这种多路径写入的最佳方式是什么?谢谢!
编辑: 在这种特殊情况下,我想实现以下目标:
HashMap<String, Object> userUpdate = new HashMap<String, Object>();
HashMap<String, String> user = new HashMap<String, String>();
user.put("firstName", "Ivan");
user.put("initialOfLastName", "V");
userUpdate.put("/user", user);
userUpdate.put("/user/gender", "male")
ref.updateChildren(userUpdate);
【问题讨论】: