I want to update multiple nodes(based on query) on Firebase. Here's the structure of the database. Firebase Database Structure Suppose, I'm updating the user information for the user "user003". As soon as I update the name and image of the user "user003", I want to search the database whose whose are friends with user003, friends are denoted as friend_list on the database. SO, upon updating the user003 information, I want to update the user003's information on the friend_list too. Hope you understand what I wanted to do. Here's the illustration of the update: Upon update. I'm using the following code to update the user003 information to the Firebase Database:
DatabaseReference ref = FirebaseDatabase.getInstance().getReference()
.child(Commonx.USER_INFORMATION);
HashMap<String, Object> userMap = new HashMap<>();
userMap.put("name", fullNameEditText.getText().toString());
userMap.put("image", imageEditText.getText().toString());
userMap.put("image", myUrl);
ref.child(Commonx.loggedUser.getUid()).updateChildren(userMap);
Here Commonx.USER_INFORMATION= "User information" on the database
. And, by Commonx.loggedUser.getUid()= the userid of the database
.