I need to do a batch update with Firebase's real-time database. I have done it like so:
This is working fine. But I need an update only for the 2nd operation. At this moment it works as set
operation. Any clue?
const updates = {}; //batch operation
// this is working fine and I need it as set operation
updates[`groups/${this.groupId}/leads/${lead.id.toString()}`] = {
name: lead.name,
address: lead.address,
};
// But problem is here. I need to write it as update operation
updates[`groups/${this.groupId}/addresses/${lead.id.toString()}`] = {
address: lead.address,
};
return this.angularFireDatabase.object('/').update(updates);