I am trying to update the node under promo id between apply and trigger location in firebase. it's not update same location where name already exists. It's disturb the ordering after update the name. I have tried method withupdate()
but fail. Then setWithPrority()
remove my other nodes(apply and trigger) and add only name node after update the name.Note data is already exist in firebase just update the name.
My script:
firebase.database().ref('/promotions/v1/' + site + '/'+ promoId).once('value').then(function (snapshot) {
promo_data = snapshot.val();
if (promo_data != null) {
var refss = firebase.database().ref('/promotions/v1/' + site + '/'+ promoId );
refss.child('/').update({"name":promoRuleName});
}
});
My Output!
Note:
I have not trigger and apply node.I have only promoRuleName string.
Expected Output!
Please help
Thanks in advance!