I'm able to query my users
array with an e-mail address and return the user's account info:
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'
...
How do I get the key (-KiBBDaj4fBDRmSS3j0r
). snapshot.key
returns users
. snapshot.child('email').key
returns email
. The key doesn't appear to be a child, i.e., it appears to be in between users
and email
.