Retrieving data with firebase for Web
<p>I am trying to retrieve data from a firebase database :</p>

<pre><code>firebase.database().ref("/appointments").orderByChild("doctor").equalTo(doctorId).on("value", function(snapshot) {
  var appointmentsData = snapshot.val();
  for(var appointment in appointmentsData) {
    if (!appointmentsData.hasOwnProperty(appointment)) continue;
    var obj = appointmentsData.appointment;
  }
});
</code></pre>

<p>If I console.log appointment or console.log appointmentsData, I get the correct value, but if I console.log appointmentsData.appointment, I get undefined.</p>

<p>Any idea how I can retrieve the properties and values from the object that firebase returns ?</p>