title: Deleting Documents from Flutter if conditionals are met
body: <p>I am trying to add a function so that whenever a button is pressed, it will take my variables and look through all documents in my database. Then when it finds a document that matches the variables, it will delete that item. However, I keep getting an error message that I need a &quot;)&quot; after the (doc). Is there a better way to run through all the items to delete them, or am I doing something wrong with the snapshots/forEach statements?</p>
  <pre><code>   Object deleteUser() {
  // Call the user's CollectionReference to add a new user
  if(name!=&quot;&quot; &amp;&amp; type!=&quot;&quot; &amp;&amp; location!=&quot;&quot;) {
        items.snapshots().forEach(
                (doc) =&gt; if(doc.data['name']==deleteName &amp;&amp; doc.data['type']==deleteType &amp;&amp; doc.data['location']==deleteLocation =&gt; doc.delete();));
        return items;
  }else{
    return &quot;There was a null error&quot;;
  }
     }
  </code></pre>