title: How to generate and guarantee unique values in firestore collection?
body: <p>Lets say we have a <code>order</code> collection in firestore where each order needs to have a unique <strong>readable</strong> random order number with lets say 8 digits:</p>
  
  <pre><code>{
      orderNumber: '19456734'
  }
  </code></pre>
  
  <p>So for every incoming order we want to generate this unique number. What is the recommended approach in firestore to make sure no other document is using it? </p>
  
  <p><em>Note</em>: One solution would be querying existing docs before saving, but this is not working in a concurrent scenario where multiple orders arrive at the same time (?).   </p>