Q:

select Firebase data with queryOrdered(byChild: "name") queryEqual

i want to select a specific name from my firebase-table (look at the picture). The result to print is always empty. The selected name should be "manni". What is wrong in my code? Thx a lot.
   @IBAction func BTSelect(_ sender: Any) {

   DBref = Database.database().reference()

    let query = DBref?.queryOrdered(byChild: "name").queryEqual(toValue: "manni")
    query?.observe(.value, with: { (snapshot) in
        for childSnapshot in snapshot.children {
            print("childSnapshot:->  \(childSnapshot)")
        }
    })

}

]1

A:

You'd use queryOrdered(byChild: "name") if each child node has a property name. But in your case, you're querying a node named name and you want to filter on the value of the child nodes. To do that, use queryOrderedByValue:
let query = DBref?.child("name").queryOrderedByValue).queryEqual(toValue: "manni")

This first orders the child nodes of name on their value, and then only returns the ones matching manni.

