title: Rxjs map and filter array- Return single object instead of array of one?
body: <p>I have a method on my service that gets all Templates, and returns an Observable array of Template objects.  I am attempting to add a new method to my service that gets the array of Templates, but filters it to get a specific template by name, in an array.</p>
  
  <p>Is there a way to get this to just return a single Template Observable, rather than an Observable Template array with one item?  I am still so new to rxjs syntax that I don't understand how to use things like reduce.</p>
  
  <p>Here's my working method to get all templates.</p>
  
  <pre><code> getAllTemplates(): Observable&lt;Template[]&gt;{
      const uri = this.baseService.rootTemplatesUri;
      return this.http.get&lt;Template[]&gt;(uri)
        .pipe(
          catchError((error: HttpErrorResponse) =&gt; { return throwError(error); })
        );
    }
  
  </code></pre>
  
  <p>Here's my attempt that is filtering by name, which returns an array with one element if there's a matching name:</p>
  
  <pre><code>getTemplateByName(name:string):Observable&lt;Template[]&gt;{
      const uri = this.baseService.rootTemplatesUri;
      return this.http.get&lt;Template[]&gt;(uri)
        .pipe(
          map(templates =&gt; {
            return templates.filter(template =&gt; {
              return template.Name === name;
            })
          }),
         catchError((error: HttpErrorResponse) =&gt; { return throwError(error); })
       );
  
    }
  </code></pre>
  
  <p>Is there a way to get a single Observable  returned by filtering this?</p>