Firebase query ordering not working properly
<p>Basically I have played with Firebase for the past week, and I recently stumbled upon the 'queryOrderedByChild()' that as far as I know - allows you to sort data in firebase. However, I seem to not get the proper results. My Firebase data looks like this: </p>

<pre><code>{
  "names" : {
    "-KHVUwXdVPHmrO_O5kil" : {
      "id" : "0",
      "name" : "Jeff"
    },
    "-KHVV7lCeac0cZNMi9fq" : {
      "id" : "3",
      "name" : "Stig"
    },
    "-KHVVCjXgl0XxasVOHF1" : {
      "id" : "13",
      "name" : "Ali"
    },
    "-KHVVJtyUO-yJZiompJO" : {
      "id" : "7",
      "name" : "Hannah"
    },
    "-KHVVR8tMSO1Oh7R8tR1" : {
      "id" : "2",
      "name" : "Amanda"
    }
  }
}
</code></pre>

<p>, and my code looks like this: </p>

<pre><code>ref.childByAppendingPath("names")
   .queryOrderedByChild("id")
   .observeEventType(.ChildAdded) { (snapshot:FDataSnapshot!) in
       if let myID = snapshot.value["id"] as? String {
           print(myID)
       }
</code></pre>

<p>The output is still in a random order, displaying: 0, 2,7,1,8,4 - Isn't this supposed to be numeric? What am I doing wrong? How can I sort it so it get's numeric either ascending or descending?</p>