title: Firebase android ordering
body: <p>I'm unable to order result with orderByChild on a date field (timestamp)</p>
  
  <p>Here the structure of data :</p>
  
  <p><a href="https://i.stack.imgur.com/OGIjh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OGIjh.png" alt="enter image description here"></a></p>
  
  <p>And the code :</p>
  
  <pre><code>  DatabaseReference mMessagesRef = FirebaseDatabase.getInstance().getReference().child("messages")
                  .child(mConversationId).getRef()
                  .orderByChild("date").getRef();
          mMessagesRef.addListenerForSingleValueEvent(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
  
                  for(DataSnapshot data: dataSnapshot.getChildren()){
  </code></pre>
  
  <p>The query returned the value, but not ordered by date, it's return by key..</p>