I have written the following code for searching the specific node and it does work correctly.
private void SearchFirebase() {
Rootref.orderByChild("IMG").equalTo(imUrl).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
for (DataSnapshot product : snapshot.getChildren()){
id = product.getKey(); //returns the id(for eg. 8006)
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
But I don't know how to access the child key-value pairs once the specific parent key is known
In the picture above I need to fetch the key-value pairs such as Product Name or Product Discount etc.