How to get the key from a Firebase data snapshot?


I am able to get the object values from firestore but how to get the key name?

1 Answer

4 years ago by

firestore()
        .collection('collection')
        .doc('document')
        .onSnapshot(function(snapshot) {
            const id = snapshot.id!
        });
4 years ago by Divya