title: Sorting data while using distributed counter
body: <p>In the Firestore guide it's <a href="https://firebase.google.com/docs/firestore/solutions/counters" rel="nofollow noreferrer">mentioned</a> that one should use distributed counters to handle multiple updates of a single document at the same time.</p>
  
  <p>This got me thinking. With this counter implementation how can you sort your data? For example let's say that I have a database of posts and each post has its own distributed counter for upvotes. Now, I'd like to get maybe 20 most upvoted posts. How can you do that?</p>
  
  <p>From my understanding of Firestore database this can't be done. Unless I'm missing something? Is there a better solution for counters for such use case I described above?</p>