title: Firebase database query by user name
body: <p>My DB looks like this :</p>
  
  <p><a href="https://i.stack.imgur.com/nN5ZF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nN5ZF.png" alt="enter image description here"></a></p>
  
  <p>In my app, I have a search bar, at the time the user search I want to find all the users with the same name or starting with the same text.</p>
  
  <p>So what I did was :</p>
  
  <pre><code>func seachUser(named : String){
      usersRef.queryOrdered(byChild: "userName")
      .queryStarting(atValue: named)
      .observeSingleEvent(of: .value) { (snap) in
                  print(snap.value)
      }
  }
  </code></pre>
  
  <p>But, each time I get all the list of the users.
  How can I fix it?
  thanks</p>