I am encountering an issue when updating data with Ionic Firebase using the following code. Instead of rewriting the previous data, it simply creates new data entries. Here is the code snippet:
updateLaporan()
{
this.id =this.fire.auth.currentUser.uid;
this.db.object('/laporan/'+ this.id+ this.uid).set({
porsiKarbohidrat : this.porsiKarbohidrat.value,
porsiProteinHewani : this.porsiProteinHewani.value,
porsiProteinNabati : this.porsiProteinNabati.value,
porsiLemak : this.porsiLemak.value,
})
this.alert("Success")
}
Here is a screenshot of my database structure: Firebase Structure This image illustrates what happens when I use that specific code: Results of Running the Code