title: How do I access another user's data by a specific field?
body: <p>I'm trying to make a user send their num to another user.
  I created a random keycode for every user to send each other a num.</p>
  <p>I tried accessing the data by querying them.</p>
  <pre><code>     const sendNum = async(e) =&gt; {
          const userCol = collection(db, &quot;users&quot;)  
          e.preventDefault();
          
  
          const targetQuery = query(userCol, where(&quot;keycode&quot;, &quot;==&quot;, target))
          const targetSnapshot = await getDocs(targetQuery)
          
          targetSnapshot.forEach((doc) =&gt; {
              console.log(doc.data().num);
          })
          console.log(targetSnapshot);
  </code></pre>
  <p>But it returns an object rather than the another user's num field</p>
  <pre><code>Nu {_firestore: xc, _userDataWriter: ah, _snapshot: Oo, metadata: Su, query: Ic}
  </code></pre>
  <p>Here's what the data looks like:</p>
  <p><a href="https://i.stack.imgur.com/l1jn8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l1jn8.png" alt="enter image description here" /></a></p>