Firebase obtenga el valor clave

firebase.database().ref("mydb").on('child_changed', function(childSnapshot) {

    console.log(childSnapshot.key,childSnapshot.val());

})
Raj Prajapati