title: Remove several items from observable array in an Angular 6 project with Firestore
body: <p>I am having trouble understanding the concept of Observables in Angular (or Typescript) and I am looking for tips that help me understand better.</p>
  
  <p>For instance, I have the following situation: I get data from a firestore db. I have processes and to each process, steps are associated in a separate collection per processid. It works fine so far to display the data.</p>
  
  <p>Now when I delete a process item, I also want to delete the associated steps.</p>
  
  <p>here is the code that I have so far:</p>
  
  <p>the following method works:</p>
  
  <pre><code>  getProcessSteps(sid:string): Observable&lt;Step[]&gt; {
      return this.steps.pipe(map(steps =&gt; steps.filter(st =&gt; st.processid == sid)));
    }
  </code></pre>
  
  <p>this one works too (apart from the call to the deleteProcessSteps method):</p>
  
  <pre><code>  deleteProcess(id) {
      // delete associated steps
      this.deleteProcessSteps(id);
  
      this.processDoc = this.afs.doc&lt;Process&gt;(`processes/${id}`);
      this.processDoc.delete();
    }
  </code></pre>
  
  <p>Here is what I would like to understand:</p>
  
  <pre><code> deleteProcessSteps(processid) {
     let stepdocs = this.getProcessSteps(processid);
  
     //Delete the steps
     for (let s of stepdocs) {         // &lt;-- not working
       this.stepDoc = this.afs.doc&lt;Step&gt;(`steps/${s.id}`);
       this.processDoc.delete();
     }
   }
  </code></pre>
  
  <p>I get the error message: Type 'Observable' is not an array type or a string type. Although I don't find that very logical, I'll have to accept it.</p>
  
  <p>Any advice on how to approach this would be extremely welcome !</p>