1

Somehow in my firebase account 2 sets of data have changed the fieldname for 'DeviceID' to 'PeripheralID' and 'DeviceUUID'. Is there a way that I can search these and change them to be 'DeviceID'? I would prefer to do this by command line but will do whatever is easier.

Im thinking something along the line of firebase update:database ?

W. Stephens
  • 729
  • 5
  • 17
  • 31
  • 3
    You'll have to download the data with `firebase database:get`, edit the resulting JSON, then re-upload. To edit the JSON, a tool such as `jq` might come in handy. –  Jul 06 '17 at 02:18
  • if i do this and import it to my realtime database would it override all of the duplicated information or just double it? – W. Stephens Jul 06 '17 at 02:28
  • 2
    There is no built-in operation to rename/move items. You will have to duplicate the data and delete the original. See my steps here for one approach: https://stackoverflow.com/questions/38997242/in-the-new-firebase-console-i-cant-edit-the-name-of-nor-move-nor-clone-any-node – Frank van Puffelen Jul 06 '17 at 03:41
  • 1
    It will overwrite. –  Jul 06 '17 at 05:24

1 Answers1

0

To answer the question with comments under question:

There is no tool for it. You'll have to download the data from database, edit JSON with some kind of text editor and upload it back to database.

This operation OVERRIDES information in database with information in JSON. In other words: uploading JSON changes database.

If you're using firebase console and data you want to change is not in whole database, you could open certain tree level and do those operation just there.

Variag
  • 1,056
  • 10
  • 25