Ir a la consola

firebase::database::Query

#include <query.h>

The Query class is used for reading data.

Summary

Listeners can be attached, which will be triggered when the data changes.

Inheritance

Direct Known Subclasses:firebase::database::DatabaseReference

Constructors and Destructors

Query()
Default constructor.
Query(const Query & query)
Copy constructor.
Query(Query && query)
Move constructor.
~Query()
Required virtual destructor.

Public functions

AddChildListener(ChildListener *listener)
void
Adds a listener that will be called any time a child is added, removed, modified, or reordered.
AddValueListener(ValueListener *listener)
void
Adds a listener that will be called immediately and then again any time the data changes.
EndAt(Variant order_value)
Get a Query constrained to nodes with the given sort value or lower.
EndAt(Variant order_value, const char *child_key)
Get a Query constrained to nodes with the given sort value or lower, and the given key or lower.
EqualTo(Variant order_value)
Get a Query constrained to nodes with the exact given sort value.
EqualTo(Variant order_value, const char *child_key)
Get a Query constrained to nodes with the exact given sort value, and the exact given key.
GetReference() const
Gets a DatabaseReference corresponding to the given location.
GetValue()
Gets the value of the query for the given location a single time.
GetValueLastResult()
Gets the result of the most recent call to GetValue().
LimitToFirst(size_t limit)
Gets a Query limited to only the first results.
LimitToLast(size_t limit)
Gets a Query limited to only the last results.
OrderByChild(const char *path)
Gets a query in which child nodes are ordered by the values of the specified path.
OrderByChild(const std::string & path)
Gets a query in which child nodes are ordered by the values of the specified path.
OrderByKey()
Gets a query in which child nodes are ordered by their keys.
OrderByPriority()
Gets a query in which child nodes are ordered by their priority.
OrderByValue()
Create a query in which nodes are ordered by their value.
RemoveAllChildListeners()
void
Removes all child listeners that were added by AddChildListener().
RemoveAllValueListeners()
void
Removes all value listeners that were added with AddValueListener().
RemoveChildListener(ChildListener *listener)
void
Removes a listener that was previously added with AddChildListener().
RemoveValueListener(ValueListener *listener)
void
Removes a listener that was previously added with AddValueListener().
SetKeepSynchronized(bool keep_sync)
void
Sets whether this location's data should be kept in sync even if there are no active Listeners.
StartAt(Variant order_value)
Get a Query constrained to nodes with the given sort value or higher.
StartAt(Variant order_value, const char *child_key)
Get a Query constrained to nodes with the given sort value or higher, and the given key or higher.
is_valid() const
virtual bool
Returns true if this query is valid, false if it is not valid.
operator=(const Query & query)
Query &
Copy assignment operator.
operator=(Query && query)
Query &
Move assignment operator.

Public functions

AddChildListener

void AddChildListener(
  ChildListener *listener
)

Adds a listener that will be called any time a child is added, removed, modified, or reordered.

Details
Parameters