I have a query that searches for users based on their age:
self?.ref.child("users").queryOrdered(byChild: "age").queryStarting(atValue: "18").queryEnding(atValue: "25").observeSingleEvent(of: .childAdded, with: { (snapshot) in
print(snapshot)
My Firebase structure is like this:
users
-> uid1
-> age : "18"
-> name : "Lisa"
-> ...
-> uid2
-> age : "18"
-> name : "Elizabeth"
-> ...
In my DB there are two people withe age : "18".
Everything works well when queryStartingAtValue is "18".
The issue occurs when I change the queryStartingAtValue to the non-existing age (e.g. "19").
Indeed, no results are returned, the data seems to be blocked inside the query.
Do you have any idea what's wrong with this query?
Thx.