答案 0 :(得分:1)
您可以执行以下操作,遍历所有节点,然后仅更改RecieversID内所有Seen的值
DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.child("Messages").child(sendersID).child(RecieversID).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for(DatasnapShot snapshot: dataSnapshot.getChildren()){
snapshot.child("Seen").setValue(true);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
System.out.println("The read failed: " + databaseError.getCode());
}
});