Also: Google Play
services
public class Query extends Object
Known Direct Subclasses |
The Query class (and its subclass, DatabaseReference
)
are used for reading data. Listeners are attached, and they will be triggered when the
corresponding data changes.
Instances of Query are obtained by calling startAt(), endAt(), or limit() on a
DatabaseReference.
Public Method Summary
ChildEventListener |
addChildEventListener(ChildEventListener
listener)
Add a listener for child events occurring at this location.
|
void |
addListenerForSingleValueEvent(ValueEventListener
listener)
Add a listener for a single change in the data at this location.
|
ValueEventListener |
addValueEventListener(ValueEventListener
listener)
Add a listener for changes in the data at this location.
|
Query | |
Query | |
Query | |
Query |
endAt(double
value)
Create a query constrained to only return child nodes with a value less than or
equal to the given value, using the given orderBy directive or priority as
default.
|
Query |
endAt(boolean
value)
Create a query constrained to only return child nodes with a value less than or
equal to the given value, using the given orderBy directive or priority as
default.
|
Query | |
Query | |
Query |
equalTo(double value)
Create a query constrained to only return child nodes with the given value
|
Query | |
Query | |
Query | |
Query |
equalTo(boolean value)
Create a query constrained to only return child nodes with the given value.
|
DatabaseReference |
getRef()
|
void |
keepSynced(boolean keepSynced)
By calling `keepSynced(true)` on a location, the data for that location will
automatically be downloaded and kept in sync, even when no listeners are
attached for that location.
|
Query |
limitToFirst(int limit)
Create a query with limit and anchor it to the start of the window
|
Query |
limitToLast(int limit)
Create a query with limit and anchor it to the end of the window
|
Query |
orderByChild(String path)
Create a query in which child nodes are ordered by the values of the specified
path.
|
Query |
orderByKey()
Create a query in which child nodes are ordered by their keys.
|
Query |
orderByPriority()
Create a query in which child nodes are ordered by their priorities.
|
Query |
orderByValue()
Create a query in which nodes are ordered by their value
|
void | |
void | |
Query |
startAt(double value)
Create a query constrained to only return child nodes with a value greater than
or equal to the given value, using the given orderBy directive or priority as
default.
|
Query | |
Query | |
Query | |
Query |
startAt(boolean value)
Create a query constrained to only return child nodes with a value greater than
or equal to the given value, using the given orderBy directive or priority as
default.
|
Query |