title: Ionic 2 - How do I pass id parameter into "http get" function so that it only display data of specific user and not all
body: <p>I am trying to load data from db server. I have a quick question: How do I pass specific user id into http get request so that it only fetch data for that user and not the entire data. I am using mongodb as db and Ionic 2 as a front-end. </p>
  
  <p>Below is my code:</p>
  
  <p>Home.html</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ion-card *ngFor="let item of items" (click)="goToOtherPage(item._id)" class="container"&gt;
    &lt;ion-list&gt;
      &lt;ion-item&gt;
        &lt;ion-avatar item-left&gt;
          &lt;!--&lt;img [src]="item.image" /&gt;--&gt;
        &lt;/ion-avatar&gt;
        &lt;h2 [innerHTML]="item.patient.name"&gt;&lt;/h2&gt;
      &lt;/ion-item&gt;
    &lt;/ion-list&gt;
  &lt;/ion-card&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Home.ts</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>load() {
  
    let params = {
      userId: '123'
    };
  
    this.tunzaProvider.load()
      .then(data =&gt; {
        this.items = data;
      });
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Provider.ts</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>load() {
  
  
    return new Promise(resolve =&gt; {
  
      this.http.get(this.apiUrl + 'getusertunzas')
        .map(res =&gt; res.json())
        .subscribe(data =&gt; {
          this.data = data;
          resolve(this.data);
        });
    });
  
  }</code></pre>
  </div>
  </div>
  </p>