Hello everyone I am getting weird behaviour here. I try to update one specific child node, when the user clicks a button. Here is my code:
var updates2 = {};
var offer = {
minusAccandShare: 2,
}
updates2['/offerLight/' + keyReal] = offer;
updates2['/offer/' + keyReal] = offer;
return firebase.database().ref().update(updates2);
Everything is working fine the correct nodes are updated but while updating minusAccandShare everything else will be deleted
The structure is like:
offer
jifdjsiavdas
minusAccandShare: -6
offerName: "Replacement"
offerText: "You have the choice to..."
...
And it becomes
offer
jifdjsiavdas
minusAccandShare: 2
I used this approach like described in the firebase guides multiple times and it always worked like a charm. But there I created completly new nodes with a new key so there was nothing to be deleted.
Thanks everyone :D