title: How to retrieve data from Firebase database in descending order?
body: <p>I was wondering If new firebase database has added this capability because I need it in my project..</p>
  
  <p>The structure looks like this.. </p>
  
  <p><a href="https://i.stack.imgur.com/DbH5t.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DbH5t.png" alt="enter image description here"></a></p>
  
  <p>and ya setting RecyclerView to reverse wont work for me because that cause it cause it to start from bottom. </p>
  
  <p><strong>Solution</strong></p>
  
  <p>So, This is the best solution i can possibly think of..For now.</p>
  
  <p>As @Frank said this could be the duplicate but I solved it initially with his help.</p>
  
  <p>so What we can do is Make the <strong>timeStamp negative</strong> i.e -20164846476589 </p>
  
  <p>and then <strong>Subtracting it with Some higher value like 999999999999999L</strong> (which for now we are not going to exceed offcourse) and then what we get Would be the lowest descending value for new Timestamp </p>
  
  <p>and the data would automagically will be descending in Firebase</p>
  
  <p>ie</p>
  
  <pre><code> String NewDescTimeStamp= String.valueOf((9999999999999L+(-1 * PreviousTimestamp)));
  
   mFirebaseRef.child(NewDescTimeStamp).setValue(true);
  </code></pre>