title: Cloud Function to sort the Firebase Child from inner child
body: <p>I need to have one problem sorted out. I want a cloud function, where I need to loop through every Posts that has uniqueID and I want to sort those uniqueID's according to the value of TotalReactions. To me more vivid, suppose, the first post has totalReactions = 5, and second one has totalReactions = 6, then I need to have another RealTimeDatabase "PostArranged" which sorts them in descending order, so second post which has Total Reaction would be in first and then follows the one which has lesser TotalReaction...<br>
  Here is how my firebase realtime database looks like: </p>
  
  <pre><code>Posts
   -L29TD-nsUYRu3wYcCQl
       Caption: "First Screenshot"
       CurrentUserReaction: "notreacted"
       Image: "https://firebasestorage.googleapis.com/v0/b/nep..."
       ReactingUser
          &lt;user-id&gt;:"1"
          &lt;user-id&gt;:"2"
       Time: "13:40:54"
       TotalReactions: "2"
       Unique: "-L29TD-nsUYRu3wYcCQl"
       UserPhoto: "https://firebasestorage.googleapis.com/v0/b/nep..."
       Username: "Me"
  </code></pre>
  
  <p>Any help would be appreciated .. </p>