title: Angular / Firestore - 'Where' query returning error 'property does not exist on type AngularFirestoreCollection'
body: <p>I'm trying to get a specific document from a firestore collection based upon an URL parameter that is passed into the argument, but as I've initialized the collection using <code>expensesCollection: AngularFirestoreCollection&lt;Expense&gt;</code>, the <code>where</code> query is returning the following error:</p>
  
  <blockquote>
    <p><em>TS2339: Property 'where' does not exist on type 'AngularFirestoreCollection</em></p>
  </blockquote>
  
  <p>The 'ViewExpense' component is accessed after clicking on a datatable row on the 'ExpensesList' component, which passes the expense ID as a parameter, which is used in the where query.</p>
  
  <p>-</p>
  
  <p><strong>expense-list.component.html:</strong></p>
  
  <pre><code>&lt;mat-row *matRowDef="let row; columns: tableColumns" routerLink="/expenses/view/{{row.expenseId}}"&gt;&lt;/mat-row&gt;
  </code></pre>
  
  <p>-</p>
  
  <p><strong>view-expense.component.ts:</strong></p>
  
  <pre><code>import { Component, OnInit, Input } from '@angular/core';
  
  import { ActivatedRoute } from '@angular/router';
  
  import { Observable } from 'rxjs/Observable';
  
  import { AngularFireDatabase } from 'angularfire2/database';
  
  import { AngularFirestore, AngularFirestoreCollection } from 'angularfire2/firestore';
  
  import { Expense } from '../expenseModel';
  
  @Component({
    selector: 'app-view-expense',
    templateUrl: './view-expense.component.html',
    styleUrls: ['./view-expense.component.scss']
  })
  
  export class ViewExpenseComponent implements OnInit {
  
    expenseId: any;
  
    expensesCollection: AngularFirestoreCollection&lt;Expense&gt;;
    expenses: Observable&lt;Expense[]&gt;;
  
    expense: Observable&lt;Expense&gt;;
  
    constructor(private db: AngularFirestore, private route: ActivatedRoute) {
      this.route.params.subscribe(params =&gt; {
          console.log(params);
          this.expenseId = params.expenseId;
      })
  
      this.expensesCollection = this.db.collection('/expenses');
  
      this.expenses = this.expensesCollection.snapshotChanges().map(changes = {
        return changes.map(a =&gt; {
          const data = a.payload.doc.data() as Expense;
          data.id = a.payload.doc.id;
          return data;
        })
      })
    }
  
    ngOnInit() {
      this.getExpense();
    }
  
    getExpense() {
      /* ---- ERROR HERE ---- */
      this.expense = this.expensesCollection.where('expenseId', '==', this.expenseId);
      console.log('this.expense: ' + this.expense);
    }
  
  }
  </code></pre>