I am having many problems with storing entities in firebase. The problem is because when the first entity is registered as a child of an entry, when I do a get request in that entry, I get a list , but when I start adding more childs to that entry, when I do a get request on it, I get an object { }. And it’s easy to iterate over a list, but what can I do when I receive an object ?
This link talks about my problem. And that’s the illustration of the problem:
@Menor_Preco, Do you have an example of a project (hopefully a small one) which demonstrates your problem? If so, could you share it here (here’s how)?
1 - Clear Database
2 - Type a string in the field
3 - Click to register
4 - Wait until the firebase requests end
5 - Wait until the “Registers list” change
You will see that you send a list in the Save Request, but when you do a Get on it, firebase returns an object. And after adding the first register, you can’t add more, because Blockly “crashes” when you try to interpret an object as a list.
@Mark, the only way I think I can do what I want is to implement a linked list in firebase, but that’s not a good solution . I’m bugged with firebase. If you get an idea, give me a light.
@Menor_Preco . I believe that you have discovered a bug in our code generation. The workaround that I would suggest would be to replace your uses of Realtime DB component with cloud variables. They can do pretty much everything that the Realtime DB component does only much more simply and they do not have the bug that is causing your problem.