title: Map Document Reference In Object with SnapshotChanges in AngularFire
body: <p>I have a class that looks like the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>export class Business {
    name: string;
    docRef: DocumentReference;
  
    constructor(name: string, docRef: DocumentReference) {
      this.name = name;
      this.docRef = docRef;
    }
  }
  
  </code></pre>
  
  <p>What I would like is to able to easily manipulate this object in Firestore to store the <code>DocumentReference</code> when getting the data. For example currently I have the following:</p>
  
  <pre><code>this.firestore.collection&lt;Business&gt;('businesses').doc&lt;Business&gt;(id).valueChanges();
  </code></pre>
  
  <p>... but I know I need to use <a href="https://github.com/angular/angularfire/blob/master/docs/firestore/documents.md#snapshotchanges" rel="nofollow noreferrer"><code>snapshotChanges</code></a> to get the metadata (i.e. the DocumentReference).</p>
  
  <p>How can I easily map the <code>DocumentReference</code> into my <code>Business</code> object when I retrieve it? Thanks for any help.</p>