title: What does a child function do in Firebase?
body: <p>I'm reading <a href="https://firebase.google.com/docs/database/web/read-and-write#get_a_database_reference" rel="nofollow noreferrer">documentation</a> for Firebase and I came to this part:</p>
  
  <pre><code>function writeNewPost(uid, username, picture, title, body) {
      // A post entry.
      var postData = {
      author: username,
      uid: uid,
      body: body,
      title: title,
      starCount: 0,
      authorPic: picture
    };
  
    // Get a key for a new Post.
    var newPostKey = firebase.database().ref().**child('posts')**.push().key;
  </code></pre>
  
  <p>How am I supposed to understand this? Currently I'm thinking this is saying "from the root of the database, create a node and store its access key in a variable". What is the use of having a child function with 'posts'? I can run similar code like the following and get the same result.</p>
  
  <pre><code>  var newPostKey = firebase.database().ref().push().key;
  </code></pre>