title: Avoid two request at same time in firestore
body: <p>I created a function to communicate with the firestore database. 
  First, check if there is something in the relation. If not then add something. 
  If something already exists then use the data and then delete the entry in the queried relation. But you have to add that in the function(else section). And now the question arises what happens when two users simultaneously perform the function. 
  Is there a way to put the second user in a queue while the first user is done with the request?</p>
  
  <pre><code>let ref = db.collection('relation1').doc('test').collection('user');
        var checkForAdd = ref.get().then(snapshot =&gt; {
          if(snapshot.size &lt; 1){
              db.collection('relation1').doc('test').collection('user').add({
                  user: 'Test',
                  createdAt: Date.now()
              }).catch(err =&gt;{
                  console.log(err)
              })
          }
  </code></pre>