My database looks like this: Database image
I am trying to get the first child of unassignedBeaconIDs, read the data beaconID, major, minor and delete it from unassignedBeaconIDs.
Here is my code:
var refBeaconID = firebase.database().ref(pathToBeaconIDs).limitToFirst(1);
refBeaconID.once('value', function(snap) {
var firstItem = snap.val(); // first item, in format {"<KEY>": "<VALUE>"}
console.log("The first item");
console.log(firstItem.beaconID);
refBeaconID.child(firstItem.key).removeValue;
});
The problem is the childAutoID Value. I always get undefined as a result.
Aucun commentaire:
Enregistrer un commentaire