title: How can I get the first document ID from a firebase collection, which is not equal to a given ID?
body: <p>I have <code>'users'</code> collection which contains documents of each user ID. I've also stored the current user's ID in a <code>userID</code> variable using the authenticated user's ID (anonymously signed in).</p>
  <p>I need to get one document ID (not the document data) based on a counter of the lowest value (document data item within this collection), and store it in a variable called 'receiverID', but if the document ID equals the current user's ID, then I would like to get the next available ID.</p>
  <p>For example, if there are 3 users on my platform (A, B, and C) and the following 'counter' values exist:</p>
  <ul>
  <li>A: 1, B: 2, C: 3</li>
  </ul>
  <p>theoretically, when A queries the collection, they will get their own doc ID back. I would then need to get the second document available within the 'users' collection.</p>
  <p>I've begun with the following but am stuck:</p>
  <pre><code>receiverID = db.collection('users').orderBy('Questions Received','asc').limit(1)
  </code></pre>
  <p>Also, this is triggered on an event listener (when a user submits a question), so the 'receiverID' must be resolved before the next part of the function. This is what my event listener looks like:</p>
  <pre><code>const sayForm = document.querySelector('#say-form');
  sayForm.addEventListener('submit', (e) =&gt; {
      e.preventDefault();
  
      db.collection('message').add({
          message: sayForm.sayInput.value,
          time: firebase.firestore.FieldValue.serverTimestamp(),
          sender: userID,
          currentReceiver: receiverID,
          received: 1
      })
      .catch(function(error) {
          console.error(&quot;Error adding document: &quot;, error);
      });
  });
  </code></pre>