{
"details": {
"-randomKey1": {
"timestamp": 1000,
"amount": 100,
"outstanding": 100
},
"-randomKey2": {
"timestamp": 2000,
"amount": -50,
"outstanding": 50
},
"-randomKey3": {
"timestamp": 3000,
"amount": 20,
"outstanding": 70
}
}
}
if amount in -randomKey2 is updated, outstanding should be updated in -randomKey2 and -randomKey3 and so on till end. -randomKey1 will not have any impact because its timestamp is less than of randomKey2 which was updated by user.
Is there any way possible to recursively update with child_changed by updating the immediate next in the list in firebase?
Can I do this in a better way? Like batch update or anything?
Thank you,
Kirtan