I\'m try to join three data using Firebase. I want to retrieve the the school name
querying to classes
data knowing only guard key which is g1
It might be too late but you would need to follow the documentation here.
something like:
var ref = new Firebase("https://myApp.firebaseio.com/");
// fetch classes
ref.child("classes").addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot snapshot, String previousChildKey) {
//get school key
String schoolKey = snapshot.getKey();
//get school name from key
ref.child("schools/" + schoolKey + "/name").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
System.out.println("The school name is " + snapshot.getValue());
}
@Override
public void onCancelled(FirebaseError firebaseError) {
// ignore for now
}
});
}
});