I want to get the total number count until specified.
this is my database: database picture
I want to count where ticket_status
is not served
ex: I want to count until A6
, I will count A1
until A5
where the value of ticket_status"
is not served
. so the final count will be 3.
is there any filtering kind?
I have this code but it just counts all nodes with the value of "not served"
dbref.child("Queue").child(a.value.toString()).orderByChild("ticket_status").equalTo("not served").addValueEventListener(object : ValueEventListener{
override fun onDataChange(snap: DataSnapshot) {
val count = snap.childrenCount
dbref.child("Student_Queue_Reserve").child(idNumber.toString()).child("people_ahead").setValue((count-1).toString())
}
override fun onCancelled(error: DatabaseError) {
}
})