How can I make an increase only in the child period of all students enrolled in Firebase?
Ex: in SQL, I would use:
UPDATE alunos
SET periodo = periodo + 1
Updating all students to their later period. How can I do it in Firebase?
How can I make an increase only in the child period of all students enrolled in Firebase?
Ex: in SQL, I would use:
UPDATE alunos
SET periodo = periodo + 1
Updating all students to their later period. How can I do it in Firebase?
I was able to accomplish what I needed by adapting the code below
DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();
DatabaseReference usersRef = rootRef.child("users");
ValueEventListener eventListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
String true = "true";
for(DataSnapshot ds : dataSnapshot.getChildren()) {
ds.child("SubmitCheck").getRef().setValue(true);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {}
};
usersRef.addListenerForSingleValueEvent(eventListener);
Source: link