Package | com.myflashlab.air.extensions.firebase.db |
Class | public class DBQuery |
Inheritance | DBQuery flash.events.EventDispatcher |
Subclasses | DBReference |
The DBQuery class (and its subclass, DBReference) are used for reading data. Listeners are attached, and they will be triggered when the corresponding data changes.
Instances of DBQuery are obtained by calling startAt(), endAt(), or limit() on a DBReference.
Property | Defined By | ||
---|---|---|---|
reference : DBReference [read-only]
Returns a DBReference to this location
| DBQuery |
Method | Defined By | ||
---|---|---|---|
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. | DBQuery | ||
Create a query constrained to only return child nodes with the given value. | DBQuery | ||
keepSynced($keepSynced:Boolean):void
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. | DBQuery | ||
limitToFirst($limit:int):DBQuery
Create a query with limit and anchor it to the start of the window
| DBQuery | ||
limitToLast($limit:int):DBQuery
Create a query with limit and anchor it to the end of the window
| DBQuery | ||
orderByChild($path:String):DBQuery
Create a query in which child nodes are ordered by the values of the specified path. | DBQuery | ||
Create a query in which child nodes are ordered by their keys. | DBQuery | ||
Create a query in which child nodes are ordered by their priorities. | DBQuery | ||
Create a query in which nodes are ordered by their value
| DBQuery | ||
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. | DBQuery |
reference | property |
reference:DBReference
[read-only] Returns a DBReference to this location
public function get reference():DBReference
endAt | () | method |
public function endAt($value:*, $key:String = null):DBQuery
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. Optionally if the $key
parameter is provided,
only child nodes with a key less than or equal to the given key will be returned.
Parameters
$value:* — The value to end at, inclusive (String/Number/Boolean)
| |
$key:String (default = null ) — The key to end at, inclusive
|
DBQuery — A Query with the new constraint
|
equalTo | () | method |
public function equalTo($value:*, $key:String = null):DBQuery
Create a query constrained to only return child nodes with the given value. Optionally if the $key
parameter is provided the returned query will be constrained to only return the child node with the given key
and value. Note that there is at most one such child as names are unique.
Parameters
$value:* — The value to query for (String/Number/Boolean)
| |
$key:String (default = null ) — The key of the child
|
DBQuery — A Query with the new constraint
|
keepSynced | () | method |
public function keepSynced($keepSynced:Boolean):void
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. Additionally, while a
location is kept synced, it will not be evicted from the persistent disk cache.
Parameters
$keepSynced:Boolean — Pass `true` to keep this location synchronized, pass `false` to stop synchronization.
|
limitToFirst | () | method |
public function limitToFirst($limit:int):DBQuery
Create a query with limit and anchor it to the start of the window
Parameters
$limit:int — The maximum number of child nodes to return
|
DBQuery — A Query with the new constraint
|
limitToLast | () | method |
public function limitToLast($limit:int):DBQuery
Create a query with limit and anchor it to the end of the window
Parameters
$limit:int — The maximum number of child nodes to return
|
DBQuery — A Query with the new constraint
|
orderByChild | () | method |
public function orderByChild($path:String):DBQuery
Create a query in which child nodes are ordered by the values of the specified path.
Parameters
$path:String — The path to the child node to use for sorting
|
DBQuery — A Query with the new constraint
|
orderByKey | () | method |
public function orderByKey():DBQuery
Create a query in which child nodes are ordered by their keys.
ReturnsDBQuery — A Query with the new constraint
|
orderByPriority | () | method |
public function orderByPriority():DBQuery
Create a query in which child nodes are ordered by their priorities.
ReturnsDBQuery — A Query with the new constraint
|
orderByValue | () | method |
public function orderByValue():DBQuery
Create a query in which nodes are ordered by their value
ReturnsDBQuery — A Query with the new constraint
|
startAt | () | method |
public function startAt($value:*, $key:String = null):DBQuery
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. Optionally if the $key
parameter is
provided, only child nodes with a key greater than or equal to the given key will be returned.
Parameters
$value:* — The value to start at, inclusive (String/Number/Boolean)
| |
$key:String (default = null ) — The key to start at, inclusive
|
DBQuery — A Query with the new constraint
|