title: Firebase understanding snapshot.child()
body: <p>consider this data structure referenced on the Firebase quick start guide (<a href="https://www.firebase.com/docs/web/api/datasnapshot/child.html" rel="nofollow">here</a>)</p>
  
  <pre><code>{"name": {"first": "Fred","last": "Flintstone"}
  </code></pre>
  
  <p>The docs say that one can access the datasnapshot location of each child object of "name" returned from a query using:</p>
  
  <pre><code>var ref = new Firebase("https://docs-examples.firebaseio.com/samplechat/users/fred");
  ref.once("value", function(snapshot) {
       var nameSnapshot = snapshot.child("name");
       var name = nameSnapshot.val();
  
       name === { first: "Fred", last: "Flintstone"}
  
       var firstNameSnapshot = snapshot.child("name/first");
       var firstName = firstNameSnapshot.val();
       firstName === "Fred"
  
       var lastNameSnapshot = snapshot.child("name").child("last");
       var lastName = lastNameSnapshot.val();
       lastName === "Flintstone"
  
       var ageSnapshot = snapshot.child("age");
       var age = ageSnapshot.val();
       age === null (because there is no "age" child in the data snapshot)
  });
  </code></pre>
  
  <p>But what's a little weird about this is when the following lines are processed. </p>
  
  <pre><code>var nameSnapshot = snapshot.child("name");
  var name = nameSnapshot.val();
  </code></pre>
  
  <p><strong>name.first</strong>, and <strong>name.last</strong> are also retrieved. So why would one use this snapshot method "child()"? Or rather when would it be beneficial to use this method, since when you pull the parent object, Firebase pulls all children, or is there a way to retrieve a parent node/object without pulling some of it's children? Then this method to me would make sense.</p>
  
  <p>Any information would be gratefully appreciated! Thanks</p>