I am new to Firebase and I’m used to using a MySQL database. Is there a way to do a replace() query? For example I’m trying to switch any instance of <“br”> with \n is it possible or do I have to manually do it?
Asked
Active
Viewed 224 times
0
-
See https://stackoverflow.com/questions/53024212/how-do-i-write-update-data-to-multiple-child-nodes-via-firebase-cloud-functions/53026539#53026539, or these answers with sample code https://stackoverflow.com/a/40592759 (JavaScript), https://stackoverflow.com/a/58977535 (Android), https://stackoverflow.com/a/41226426 (Node.js). – Frank van Puffelen Dec 08 '19 at 20:05
-
That said, there is no support in Firebase to find all child nodes that **contain** a certain substring. See https://stackoverflow.com/a/22522874, and https://stackoverflow.com/a/28612040 – Frank van Puffelen Dec 08 '19 at 20:08
1 Answers
1
Realtime Database does not have an equivalent to "UPDATE WHERE" in SQL. If you want to replace all occurrences of something, you have to locate all of them and update them each individually. The SDK provides a way to do multi-location updates in order to make them update atomically, but you have to provide each individual location, and the final value to write.

Doug Stevenson
- 297,357
- 32
- 422
- 441