title: Unity-Firebase Realtime Database - OrderByChild or OrderByValue does not work
body: <p>I try to develop a leaderboard system using Firebase Realtime Database using Unity.</p>
  
  <p>I can store and load the score values, everything works ok.
  However, when I try to retrieve the scores in order, I cannot manage to do. I do as exactly described in:
  <a href="https://firebase.google.com/docs/database/unity/retrieve-data#sort_data" rel="nofollow noreferrer">https://firebase.google.com/docs/database/unity/retrieve-data#sort_data</a></p>
  
  <p>The structure of the data in my firebase console is as follows:</p>
  
  <h2><a href="https://i.stack.imgur.com/L6jmP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L6jmP.png" alt="enter image description here"></a></h2>
  
  <p>My "orderByChild" using code is as below:</p>
  
  <pre><code>// Set the leaderboard reference
          m_leaderBoardDBReference = mDatabaseReference.Child ("Users");
  
          // Get the data, order by child "highScore"
          m_leaderBoardDBReference.OrderByChild("highScore").GetValueAsync().ContinueWith(task =&gt; {
              if (task.IsFaulted) {
                  // Handle the error...
                  Debug.Log("Data " + lbAddress + " not found");
              }else if (task.IsCompleted) {
                  DataSnapshot snapshot = task.Result;
                  // Print the raw json value of the leaderboard data
                  Debug.Log("Leaderboard Raw Json Value\n");
                  Debug.Log(snapshot.GetRawJsonValue());
              }
          });
  </code></pre>
  
  <p>I get the following result:</p>
  
  <pre><code>Leaderboard Raw Json Value
  {"user3":{"highScore":49},"user4":{"highScore":0},"user5":{"highScore":69},"user6":{"highScore":155}}
  </code></pre>
  
  <p>In other words, it is <strong>not</strong> properly ordered.</p>
  
  <p>I also tried the "OrderByValue" version as follows:</p>
  
  <pre><code>// Set the leaderboard reference
      m_leaderBoardDBReference = mDatabaseReference.Child ("Contests/AprilMay");
  
      // Get the data, order by value
  
  m_leaderBoardDBReference.OrderByValue().GetValueAsync().ContinueWith(task =&gt; {
              if (task.IsFaulted) {
                  // Handle the error...
                  Debug.Log("Data " + lbAddress + " not found");
              }else if (task.IsCompleted) {
                  DataSnapshot snapshot = task.Result;
                  // Print the raw json value of the leaderboard data
                  Debug.Log("Leaderboard Raw Json Value\n");
                  Debug.Log(snapshot.GetRawJsonValue());
              }
          });
  </code></pre>
  
  <p>The structure:</p>
  
  <p><a href="https://i.stack.imgur.com/JMisA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JMisA.png" alt="enter image description here"></a></p>
  
  <p>The output:</p>
  
  <pre><code>Leaderboard Raw Json Value
  {"dummy":0,"user3":240,"user5":69,"user6":155}
  </code></pre>