title: Get ID of Firebase Pushed Object Is Undefined
body: <p>Something very strange is happening whenever I try to get the ID of an item I pushed to my Firebase database... I used the code directly from <a href="https://www.firebase.com/blog/2013-04-12-denormalizing-is-normal.html" rel="nofollow">one of their examples</a>:</p>
  
  <pre><code>var fireBaseRef = new Firebase(FIREBASE_ROOT);
  var id = fireBaseRef.child("flintstones").push();
  id.set({
      first: 'Fred',
      last: 'Flintstone'
  }, function (err) {
      if (!err) {
          //var name = id.key();
          console.log("Set with ID: " + id);
      }
  });
  </code></pre>
  
  <p>When this code is run everything works as expected, the Forge portal shows the data was written properly to the database and I get the appropriate javascript console message:</p>
  
  <pre><code>"Set with ID: https://myfirebaseurl.com/flintstones/-JfjdUW4BT32DMgeuAdt"
  </code></pre>
  
  <p>The problem arises when I uncomment the line </p>
  
  <pre><code>var name = id.key();
  </code></pre>
  
  <p>As soon as I do that I get a javascript error indicating that no such method exists ("Uncaught TypeError: undefined is not a function."), I don't know what this is happening and I need to use the key value (in this case "-JfjdUW4BT32DMgeuAdt") elsewhere. </p>
  
  <p>Can anyone tell me where I went wrong?</p>