I am trying to retrieve data from firebase realtime database and I want to add it to a local variable and want to add some more data to it then again want to push it back at same location. here's my code.. and screenshot of database structure... help me handling the data ...
DatabaseReference userEvent = await userRef.child(user.uid).child("purchasedCategories");
Stream<DatabaseEvent> stream = userEvent.onValue;
stream.listen((DatabaseEvent event) {
print('Snapshot: ${event.snapshot.value.}');
});
this is the database structure:

I want to retrieve values from purchasedCategories and add more values to it.
I want a code snippet or reference which can help me handling the data add more data to it and again upload it back