Packagecom.myflashlab.air.extensions.firebase.db
Classpublic class DBQuery
InheritanceDBQuery Inheritance 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.



Public Properties
 PropertyDefined By
  reference : DBReference
[read-only] Returns a DBReference to this location
DBQuery
Public Methods
 MethodDefined By
  
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.
DBQuery
  
equalTo($value:*, $key:String = null):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
  
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.
DBQuery
Property Detail
referenceproperty
reference:DBReference  [read-only]

Returns a DBReference to this location


Implementation
    public function get reference():DBReference
Method Detail
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

Returns
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

Returns
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

Returns
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

Returns
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

Returns
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.

Returns
DBQuery — A Query with the new constraint
orderByPriority()method 
public function orderByPriority():DBQuery

Create a query in which child nodes are ordered by their priorities.

Returns
DBQuery — A Query with the new constraint
orderByValue()method 
public function orderByValue():DBQuery

Create a query in which nodes are ordered by their value

Returns
DBQuery — 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

Returns
DBQuery — A Query with the new constraint