title: How to get the key from a Firebase data snapshot?
body: <p>I'm able to query my <code>users</code> array with an e-mail address and return the user's account info:</p>
  
  <pre><code>users.orderByChild('email').equalTo(authData.user.email).once('value').then(function(snapshot) {
          console.log(snapshot.val());
          console.log(snapshot.key); // 'users'
          console.log(snapshot.child('email').key); 'email'
          ...
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AzaMu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AzaMu.png" alt="enter image description here"></a></p>
  
  <p>How do I get the key (<code>-KiBBDaj4fBDRmSS3j0r</code>). <code>snapshot.key</code> returns <code>users</code>. <code>snapshot.child('email').key</code> returns <code>email</code>. The key doesn't appear to be a child, i.e., it appears to be in between <code>users</code> and <code>email</code>. </p>