-
Notifications
You must be signed in to change notification settings - Fork 79
Realtime Database
The Realtime Database functionality includes dynamic updates via the server-sent events protocol as implemented by Firebase. As such, database updates can happen and everyone connected to any path that's updated will be updated directly without the need to do a get at that path. This will store the data automatically for you as well and send a signal with the latest info.
Firebase.Database
Functions | Description |
---|---|
get_database_reference(path : String, filter : Dictionary) -> FirebaseDatabaseReference |
Create a reference to a specific path inside the Realtime Database. |
Properties | Description |
---|
Signals | Description |
---|
FirebaseDatabaseReference
Functions | Description |
---|
Properties | Description |
---|
Signals | Description |
---|---|
new_data_update(data) |
Emitted when new data is added to the path. |
patch_data_update(data) |
Emitted when data is updated within the path. |
push_successful() |
Emitted when data has been successfully pushed to the path. |
push_failed() |
Emitted when a request to push data to the path has failed. |
***
Note you need to be authenticated for this to work The below will get you a basic reference to a path in the database; this will be updated automatically as the path is updated in the realtime database.
var db_ref = Firebase.Database.get_database_reference("path_to_position_in_database", {})
Note you need to be authenticated for this to work The below will get you a filtered database reference to a path in your database. Note the constants supported for filtering are contained in Firebase.Database, near the top of the file.
var db_ref = Firebase.Database.get_database_reference("path_to_position_in_database", { Firebase.Database.LIMIT_TO_LAST : 10 })
Note you need to be authenticated The below will update the data at a given path.
func update(path : String, data : Dictionary) -> void:
```***