I need to set all the child distances to 0 (check photo of Firebase db below) in 1 setting. Is there any way I can do this? The usual update function for Firebase generally works for only one userID.
Asked
Active
Viewed 737 times
0

Frank van Puffelen
- 565,676
- 79
- 828
- 807

Jason Singh
- 75
- 1
- 6
-
The easiest way would be to create a firebase function for this. – Zonily Jame Apr 26 '19 at 06:51
1 Answers
1
To write a value, the client must specify the complete path to that value in the database. Firebase does not support the equivalent of SQL's update queries.
So you will need to first load the data, and then update each child. You can perform those updates in a big batch if you want, using multi-location updates. For more on those, see the blog post introducing them and the answer here: Firebase - atomic write of multiple values to multiple locations

Frank van Puffelen
- 565,676
- 79
- 828
- 807