0
votes

when exporting parts of my Firebase Real-time Database, the JSON file is incomplete. How do I make sure that what looks similar on the web interface, looks similar on the export file?

Here is, how a part of the whole thing looks on the web: In my firebase database

And here is how the same section looks after exporting it as JSON: After JSON export

The "machVoting" entry should not be the reason as this problem exists with branches only having a "voting" entry as well.

Are there any other WYSIWYG export options?

Thanks in advance

2

2 Answers

1
votes

In general it's wise to avoid numeric keys in the Realtime Database. As you are seeing in your export, they get coerced into arrays. Better to use strings or a string prefix (e.g. v1, v2, etc.).

The difference you're seeing is caused by the numeric keys.

0
votes

Your problem start with this [

in first node your json format is correct, but in 3rd you are using this [] so its array and all entry will be generated as array index.

If you want custom keys then use Object(var object1 = {};) instead of array.

Your 3rd node should be like below code

"node_3rd":{
  "13" :{
   "matchVote": "1",
   "vote": "3"
  }
  "14" :{
   "matchVote": "5",
   "vote": "7"
  }
}