title: Angular Firebase Querying?
body: <p>This is my .ts file to query the angular firebase database</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/database';
  
  @Component({
    selector: 'app-candidate-reg-success',
    templateUrl: './candidate-reg-success.component.html',
    styleUrls: ['./candidate-reg-success.component.css']
  })
  export class CandidateRegSuccessComponent implements OnInit {
    result:any;
   items: FirebaseListObservable&lt;any[]&gt;;
    constructor(db: AngularFireDatabase) { 
    debugger;
      this.items=db.list('/candidates_list',{
        query:{
          orderByChild:'email',
          equalTo:'pranavkeke@gmail.com'
  
        }
  
  
      });
  
      this.items.subscribe(quiredItems=&gt;{
        this.result=quiredItems;
         console.log(this.result);
         console.log(this.result.FirstName);
        //  console.log();
      });
      // debugger;
      // const rootRef=firebase.database().ref();
      // const mail=rootRef.child('candidates_list').orderByChild('email').equalTo('pranavkeke@gmail.com');
      // console.log(mail);
  
    }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>I am getting the user with specified criteria, but I want only the firstname of the user.The problem is with this one</p>
  
  <pre><code>console.log(this.result.FirstName);
  </code></pre>
  
  <p>The result variable holds all the json data from firebase, butI want only firstname. But in console it shows undefined. How can be it solved? Please help me. Thanks in advance.</p>