title: How to get the firebase document ID inside my object when using ngxs-lab/firestore-plugin
body: <p>I'm using NGXS for my state management and also using the firestore-plugin(<a href="https://github.com/ngxs-labs/firestore-plugin" rel="nofollow noreferrer">https://github.com/ngxs-labs/firestore-plugin</a>).</p>
  <p>How do I add the id of the document inside my object?</p>
  <p>I've created my store:</p>
  <pre><code>import { Injectable } from '@angular/core';
  import { NgxsFirestore } from '@ngxs-labs/firestore-plugin';
  
  @Injectable({
    providedIn: 'root',
  })
  export class SpotsFirestore extends NgxsFirestore&lt;Spot&gt; {
    protected path = 'seasons/2021/spots';
  }
  </code></pre>
  <p>I've created my state&amp;actions:</p>
  <pre><code>import { Injectable } from '@angular/core';
  import { Emitted, NgxsFirestoreConnect, StreamEmitted } from '@ngxs-labs/firestore-plugin';
  import { Action, NgxsOnInit, Selector, State, StateContext } from '@ngxs/store';
  import { InitializeSpotsAction } from './spots.actions';
  import { SpotsFirestore } from './spots.firestore';
  
  export interface SpotsStateModel {
    spots: Spot[];
  }
  
  @State&lt;SpotsStateModel&gt;({
    name: 'spots',
    defaults: {
      spots: [],
    },
  })
  @Injectable()
  export class SpotsState implements NgxsOnInit {
    @Selector()
    static spots(state: SpotsStateModel) {
      return state.spots;
    }
  
    constructor(private spotsFireStore: SpotsFirestore, private ngxsFirestoreConnect: NgxsFirestoreConnect) {}
    ngxsOnInit(ctx?: StateContext&lt;any&gt;) {
      this.ngxsFirestoreConnect.connect(InitializeSpotsAction, {
        to: (action) =&gt; this.spotsFireStore.collection$(),
      });
    }
  
    @Action(StreamEmitted(InitializeSpotsAction))
    getAllEmitted(ctx: StateContext&lt;SpotsStateModel&gt;, { action, payload }: Emitted&lt;InitializeSpotsAction, Spot[]&gt;) {
      ctx.patchState({ spots: payload });
    }
  }
  </code></pre>
  <p>and my model looks like this:</p>
  <pre><code>interface Spot {
    id: string;
    name: string;
    description: string;
    checkinValue: number;
    imageUrl: string;
    coordinates: firebase.firestore.GeoPoint;
  }
  </code></pre>
  <p>so obviously, id isn't inside my firebase document but is identifying it. But it will definitely be usefull for me to have it.</p>
  <p>I guess I should override something in NgxsFirestore, but I can't figure out what on how?
  Is it mandatory to have it inside the document?</p>