I'm developing an android app and in this app users should be able to search for other users knowing a certain language depending on their preferences. To do that I get the desired language and make a query in the database but I couldn't figure out how to bring values here.
So below you see my database structure in the picture.Say user selected a language called "Italian" and this should return the all users knowing Italian language.
Here is the code: for example, it should return the users like Ridvan and Fenerbahce if they have a language with Italian.
DatabaseReference myRootRef = FirebaseDatabase.getInstance().getReference("Users");
myRootRef.child("Users").orderByChild("Languages").equalTo(Language).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}