title: The document is not a function?
body: <p>I am writing in JavaScript. I have this if statement:</p>
  
  <pre><code>var rightsRef = db.collection("users").document(uid).collection("rights");
          if(createDocumentWithId(rightsRef, "readGrades", "false", null, null, null, null) === true) {
            window.location.href = "../public/main/main_index.html";
          }  
  </code></pre>
  
  <p>And here is the function who should add the values in cloud firestore:  </p>
  
  <pre><code>function createDocumentWithoutId(var databaseRef, var titleValue1, var contentValue1, var titleValue2, var contentValue2, var titleValue3, var contentValue3) {
    databaseRef.add({
      titleValue1: contentValue1,
      titleValue2: contentValue2,
      titleValue3: contentValue3,
    }).then(function() {
      return true;
    }).catch(function(error) {
      console.error("Error adding document: ", error);
      return false;
    });
  }  
  </code></pre>
  
  <p>But I am getting this error:  </p>
  
  <pre><code>TypeError: db.collection(...).document is not a function
  </code></pre>