i'm trying to get the data based on "Payments" in child "State" in my structured data My Structured firebase
I used this
salesRef = FirebaseDatabase.getInstance().getReference()
.child("Orders")
.orderByKey().startAt("Payments").endAt("Payments"+"\uf8ff");
but i got nothing back.What was wrong ? What should i use?
You need to do the following:
salesRef = FirebaseDatabase.getInstance().getReference().child("Orders").orderByChild("state").equalTo("Waiting Payments Config");
orderByChild will take the name of an attribute as an argument and, equalTo will take the value of that attribute as an argument.
Check the docs:
https://firebase.google.com/docs/database/android/lists-of-data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With