Ir a la consola

firebase::database::DatabaseReference

#include <database_reference.h>

DatabaseReference represents a particular location in your Database and can be used for reading or writing data to that Database location.

Summary

This class is the starting point for all Database operations. After you've initialized it with a URL, you can use it to read data, write data, and to create new DatabaseReference instances.

Inheritance

Inherits from: firebase::database::Query

Constructors and Destructors

DatabaseReference()
Default constructor.
DatabaseReference(const DatabaseReference & reference)
Copy constructor.
DatabaseReference(DatabaseReference && reference)
Move constructor.
~DatabaseReference()
Required virtual destructor.

Public functions

Child(const char *path) const
Gets a reference to a location relative to this one.
Child(const std::string & path) const
Gets a reference to a location relative to this one.
GetParent() const
Gets the parent of this location, or get this location again if IsRoot().
GetRoot() const
Gets the root of the database.
GoOffline()
void
Manually disconnect Firebase Realtime Database from the server, and disable automatic reconnection.
GoOnline()
void
Manually reestablish connection to the Firebase Realtime Database server and enable automatic reconnection.
OnDisconnect()
Get the disconnect handler, which controls what actions the server will perform to this location's data when this client disconnects.
PushChild() const
Automatically generates a child location, create a reference to it, and returns that reference to it.
RemoveValue()
Future< void >
Removes the value at this location from the database.
RemoveValueLastResult()
Future< void >
Gets the result of the most recent call to RemoveValue();.
RunTransaction(DoTransactionWithContext transaction_function, void *context, bool trigger_local_events)
Run a user-supplied callback function (passing in a context), possibly multiple times, to perform an atomic transaction on the database.
RunTransaction(DoTransactionFunction transaction_function, bool trigger_local_events)
Run a user-supplied callback, possibly multiple times, to perform an atomic transaction on the database.
RunTransaction(DoTransaction transaction_function, bool trigger_local_events)
Run a user-supplied callback function, possibly multiple times, to perform an atomic transaction on the database.
RunTransactionLastResult()
Get the result of the most recent call to RunTransaction().
SetPriority(Variant priority)
Future< void >
Sets the priority of this field, which controls its sort order relative to its siblings.
SetPriorityLastResult()
Future< void >
Gets the result of the most recent call to SetPriority().
SetValue(Variant value)
Future< void >
Sets the data at this location to the given value.
SetValueAndPriority(Variant value, Variant priority)
Future< void >
Sets both the data and priority of this location.
SetValueAndPriorityLastResult()
Future< void >
Get the result of the most recent call to SetValueAndPriority().
SetValueLastResult()
Future< void >
Gets the result of the most recent call to SetValue().
UpdateChildren(Variant values)
Future< void >
Updates the specified child keys to the given values.
UpdateChildren(const std::map< std::string, Variant > & values)
Future< void >
Updates the specified child keys to the given values.
UpdateChildrenLastResult()