title: Firebase Push to Database with Array of Objects
body: <p>The firebase database push method adds an object to the database child with a unique key, e.g.,</p>
  
  <pre><code>postsRef.push({
    author: "gracehop",
    title: "Announcing COBOL, a New Programming Language"
  });
  </code></pre>
  
  <p>puts something like the following in the database</p>
  
  <pre><code>"posts": {
      "-JRHTHaIs-jNPLXOQivY": {
        "author": "gracehop",
        "title": "Announcing COBOL, a New Programming Language"
      }
  </code></pre>
  
  <p>However, if I use the push method with an array of objects, e.g.</p>
  
  <pre><code>    postsRef.push({
          {
            author: "gracehop1",
            title: "Announcing COBOL, a New Programming Language"
          },
          {
            author: "gracehop2",
            title: "Announcing COBOL, a New Programming Language"
          }});
  </code></pre>
  
  <p>I get a single unique key with enumerated objects in the database, i.e.,</p>
  
  <pre><code>"posts": {
      "-JRHTHaIs-jNPLXOQivY": {
        "0": { 
           "author": "gracehop1",
           "title": "Announcing COBOL, a New Programming Language"
         },
        "1": {
           "author": "gracehop2",
           "title": "Announcing COBOL, a New Programming Language"
         }
       }}
  </code></pre>
  
  <p>Is there any way to <code>push</code> an array of objects in a single transaction such that i get a unique key for each object in the array, i.e., a result that looks something like</p>
  
  <pre><code>"posts": {
          "-JRHTHaIs-jNPLXOQivY": {
               "author": "gracehop1",
               "title": "Announcing COBOL, a New Programming Language"
           "-JRHTHaIs-jNPLXOQivZ": {
               "author": "gracehop2",
               "title": "Announcing COBOL, a New Programming Language"
             }
           }}
  </code></pre>