'Firebase RTDB - Get document ID?
Solution 1:[1]
This is how you can get keys from array in RTDB:
onValue(dbRef, (snapshot) => {
snapshot.forEach((childSnapshot) => {
const childKey = childSnapshot.key;
const childData = childSnapshot.val();
// ...
});
}, {
onlyOnce: true
});
You need to get to childSnapshots using forEach or for loop.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mises |


