So I have a database in this format: 
I need to be able to get the name, price and quantity after I search the database for the barcode.
I tried something like this:
mFirebaseInstance = FirebaseDatabase.getInstance();
mFirebaseDatabase = mFirebaseInstance.getReference("ProductData");
UserId = mFirebaseDatabase.push().getKey();
public void searchProduct(String barcode){
mFirebaseDatabase.child("Products").child("barcode").equalTo(barcode).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
Log.d("DBVAL", String.valueOf(dataSnapshot.getValue()));
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
Here is the output:
D/DBVAL: null