title: Retrieve Data from a Many-to-Many Structure Similar to Prase query.include
body: <p>We are migrating an app from Parse to Firebase and I'd like to build a UI where I can show the student name along with the classroom that s/he belongs to from the following Firebase data structure. For example, the class room name for <code>aluck</code> is <code>10th Grade</code>. </p>
  
  <pre><code>{
      "students": {
          "aluck": {
              "firstName": "Andrew",
              "lastName": "Luck",
              "classroom": "-KJlJhyNH6ImKke-qAd-"
          },
          "bmorino": {
              "firstName": "Beth",
              "lastName": "Morino",
              "classroom": "-KJlJhyNH6ImKke-qAd-"
          }
      },
      "classRooms": {
          "-KJlJhyNH6ImKke-qAd-": {
              "location": "Down stairs",
              "name": "10th Grade",
              "students": {
                  "aluck": true,
                  "bmorino": true,
              }
          }
      }
  }
  </code></pre>
  
  <p>My assumption was when I do something like this using the Firebase JavaScript SDK,</p>
  
  <pre><code>var db = firebase.database(); 
  db.ref("students/aluck").on("value", function(snap) { 
      // success method will expose the classroom object with it 
  }); 
  </code></pre>
  
  <p>it will expose the <code>classRooms</code> object, but it does not.</p>
  
  <p>In Parse, I was able to do</p>
  
  <pre><code>var query = new Parse.Query(Student);
  query.include("ClassRoom");
  </code></pre>
  
  <p>and it'll expose both the <code>Student</code> and <code>ClassRoom</code> objects.</p>
  
  <p>Any help is appreciated.</p>