title: Firestore - How to check if a document exist based on a specific field
body: <p>What I want to achieve is to check if a document exist based on a field like liker_id and if it exist then return and if not then create a new document with the liker_id.</p>
  
  <p>I've tried both snapshot.exists and doc.exists but they seem to give weird behaviors where the console.log doesn't get triggered or collection still adds document even though it already exists.   </p>
  
  <pre><code>const liker = db
    .collection("post")
    .doc('ubxL0nDCLHgrtEyQ5TEV')
    .collection("votes")
    .where("liker_id", "==", "user-TVe8mMRU47cnfO4xbl9yQEEE4XB3")
    .get()
    .then(snapshot =&gt; {
      snapshot.forEach(doc =&gt; {
        if (doc.exists) {
          console.log("exist");
        } else {
          console.log("not exist");
        }
      });
    })
    .catch(error =&gt; {
      console.log(error);
    });
  </code></pre>