GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
554 stars 79 forks source link

Get Data from existing realtime database object #114

Closed Zarasan closed 3 years ago

Zarasan commented 3 years ago

I have a realtime database set up and I am trying to get data from it. I could only find new_data_update and patch_data_update signals, how do I get existing data?

WolfgangSenff commented 3 years ago

It should be in the new_data_update signal.

Zarasan commented 3 years ago
var fstore
fstore = Firebase.Database.get_database_reference('Users/01ojEi6zjaNR82CxvBc0Zfvt9pa2', {})
fstore.connect("new_data_update", self, "on_received_new_chat")

and I never get a signal with the data that is there in the database, am I doing something wrong? Should I call get() like in firestore?

BearDooks commented 3 years ago

@Zarasan when new data is added, can you see it in the console at that path?

Are you sure the path you have connected to is correct?

WolfgangSenff commented 3 years ago

Can I see the definition of the on_received_new_chat function?

Zarasan commented 3 years ago

Had my rules set to "auth != null" so I couldnt get the data, I was getting permission denied in the background.

Zarasan commented 3 years ago

This problem was on my end. Sorry for disturbing you. Thank you so much for helping

WolfgangSenff commented 3 years ago

It's cool - it's what we're here for. :) Good luck!

WolfgangSenff commented 3 years ago

@Zarasan - by the way, I recently fixed a dumb bug with the authorization stuff. The fix is already in latest, but if you're using the branch from the Godot Asset Library, you likely won't have it. It's an easy fix though and since it's the latest thing to be merged, very easy to see what you have to do for the fix.