title: Swift cannot convert value of type 'Query' to expected argument type 'DocumentReference'
body: <p>Essentially, what I'm trying to do is, once the postTaskButton is tapped, copy the information from titleTextField to a new document in the &quot;prtasks&quot; collection and then copy it to the currently signed in user's personal document in the &quot;users&quot; collection.</p>
  <p>To do so, I've tried execute a batched write once the 'PostTasks' Button is tapped. However, Xcode presents the error &quot;Cannot convert value of type 'Query' to expected argument type 'DocumentReference'&quot; for the line in bold.</p>
  <pre><code>    @IBAction func postTaskButton(_ sender: Any) {
      
      let title = titleTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
      let db = Firestore.firestore()
      let batch = db.batch()
      
      //Copy the information from the form to the 'prtasks' root collection
      let prtasksRef = db.collection(&quot;prtasks&quot;).document()
      batch.setData([&quot;title&quot; : title], forDocument: prtasksRef)
      
      //Copy the information from the form to a map entry in the user's personal tasks collection
      let userTasksRef = db.collection(&quot;users&quot;).whereField(&quot;uid&quot;, isEqualTo: Auth.auth().currentUser?.uid ?? &quot;&quot;)
      **batch.setData([&quot;title&quot;: title], forDocument: userTasksRef)**
  
      //Commit all of the above batch writes to the firestore
      batch.commit() { (error) in
          if error != nil {
              self.showAlert(for: &quot;Error Writing Batch&quot;)
          } else {
              self.showAlert(for: &quot;Batch write succeeded.&quot;)
          }
      }
  
  }
  </code></pre>