Package | com.distriqt.extension.firebase.firestore |
Interface | public interface Query extends flash.events.IEventDispatcher |
Method | Defined By | ||
---|---|---|---|
addOnQueryFailureListener(handler:Function):Query
Use this function to add a failure handler callback for the query() method. | Query | ||
addOnQuerySuccessHandler(handler:Function):Query
Use this function to add a success handler callback for the query() method. | Query | ||
addSnapshotListener(listener:Function, metadataChanges:int):void
Starts listening to this query. | Query | ||
Creates and returns a new Query that ends at the provided fields relative to
the order of the query. | Query | ||
Creates and returns a new Query that ends at the provided document (inclusive). | Query | ||
Creates and returns a new Query that ends before the provided fields relative
to the order of the query. | Query | ||
Creates and returns a new Query that ends before the provided document (exclusive). | Query | ||
Creates and returns a Query that's additionally limited to only return up to the
specified number of documents. | Query | ||
Creates and returns a new Query that's additionally sorted by the specified field. | Query | ||
Perform a query to retrieve the documents in this collection. | Query | ||
removeSnapshotListener(listener:Function):void
Stops listening to this query. | Query | ||
startAfter(... fieldValues):Query
Creates and returns a new Query that starts after the provided fields relative
to the order of the query. | Query | ||
Creates and returns a new Query that starts after the provided document (exclusive). | Query | ||
Creates and returns a new Query that starts at the provided fields relative
to the order of the query. | Query | ||
Creates and returns a new Query that starts at the provided document (inclusive). | Query | ||
Creates and returns a new Query with the additional filter. | Query | ||
whereEqualTo(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents
must contain the specified field and the value should be equal to the specified value. | Query | ||
whereGreaterThan(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents
must contain the specified field and the value should be greater than the
specified value. | Query | ||
whereGreaterThanOrEqualTo(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents
must contain the specified field and the value should be greater than or
equal to the specified value. | Query | ||
whereLessThan(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents
must contain the specified field and the value should be less than the
specified value. | Query | ||
whereLessThanOrEqualTo(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents
must contain the specified field and the value should be less than or equal
to the specified value. | Query |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when an error occurred during the query or if there was an issue with the query parameters. | Query | |||
Dispatched when the data of the document changes | Query | |||
Dispatched when the query was successful and the snapshot will contain the query results. | Query |
addOnQueryFailureListener | () | method |
public function addOnQueryFailureListener(handler:Function):Query
Use this function to add a failure handler callback for the query()
method.
The handler function will be called if the query
call was unsuccessful and will contain the error message as the first parameter.
Parameters
handler:Function — The handler function called when an error occurs, should take one String parameter which will be the error message
|
Query — The Query instance for chaining calls
|
addOnQuerySuccessHandler | () | method |
public function addOnQuerySuccessHandler(handler:Function):Query
Use this function to add a success handler callback for the query()
method.
The handler function will be called if the query
call was successful and will contain the query result as the first parameter.
Parameters
handler:Function — The handler function called when an success occurs, should take one QuerySnapshot parameter
|
Query — The Query instance for chaining calls
|
addSnapshotListener | () | method |
public function addSnapshotListener(listener:Function, metadataChanges:int):void
Starts listening to this query.
Changes to the query will be returned to the listener function as a QueryEvent
The listener function should have the following signature: function(event:QueryEvent):void
Parameters
listener:Function — The function to call when changes occur
| |
metadataChanges:int (default = NaN ) — Indicates whether metadata-only changes (i.e. only QuerySnapshot.getMetadata() changed) should trigger snapshot events.
|
endAt | () | method |
public function endAt(... fieldValues):Query
Creates and returns a new Query that ends at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters
... fieldValues — The field values to end this query at, in order of the query's order by.
|
Query — The Query instance for chaining calls
|
endAtSnapshot | () | method |
public function endAtSnapshot(snapshot:DocumentSnapshot):Query
Creates and returns a new Query that ends at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters
snapshot:DocumentSnapshot — The snapshot of the document to end at.
|
Query — The created Query
|
endBefore | () | method |
public function endBefore(... fieldValues):Query
Creates and returns a new Query that ends before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters
... fieldValues — The field values to end this query at, in order of the query's order by.
|
Query — The Query instance for chaining calls
|
endBeforeSnapshot | () | method |
public function endBeforeSnapshot(snapshot:DocumentSnapshot):Query
Creates and returns a new Query that ends before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters
snapshot:DocumentSnapshot — The snapshot of the document to end before.
|
Query — The created Query
|
limit | () | method |
public function limit(limit:int):Query
Creates and returns a Query that's additionally limited to only return up to the specified number of documents.
Parameters
limit:int — The maximum number of items to return.
|
Query — The Query instance for chaining calls
|
orderBy | () | method |
public function orderBy(field:String, direction:int):Query
Creates and returns a new Query that's additionally sorted by the specified field. Optionally in descending order instead of ascending.
Parameters
field:String — The field to sort by.
| |
direction:int (default = NaN ) — The direction to sort.
|
Query — The Query instance for chaining calls
|
query | () | method |
public function query(source:String):Query
Perform a query to retrieve the documents in this collection.
By default, query()
attempts to provide up-to-date data when possible
by waiting for data from the server, but it may return cached data
or fail if you are offline and the server cannot be reached.
This behavior can be altered via the source
parameter.
Parameters
source:String (default = NaN )
|
Query — The Query instance for chaining calls
|
removeSnapshotListener | () | method |
public function removeSnapshotListener(listener:Function):void
Stops listening to this query.
Parameters
listener:Function — The function to call when changes occur
|
startAfter | () | method |
public function startAfter(... fieldValues):Query
Creates and returns a new Query that starts after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters
... fieldValues — The field values to start this query after, in order of the query's order by.
|
Query — The Query instance for chaining calls
|
startAfterSnapshot | () | method |
public function startAfterSnapshot(snapshot:DocumentSnapshot):Query
Creates and returns a new Query that starts after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters
snapshot:DocumentSnapshot — The snapshot of the document to start after.
|
Query — The created Query
|
startAt | () | method |
public function startAt(... fieldValues):Query
Creates and returns a new Query that starts at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters
... fieldValues — The field values to start this query after, in order of the query's order by.
|
Query — The Query instance for chaining calls
|
startAtSnapshot | () | method |
public function startAtSnapshot(snapshot:DocumentSnapshot):Query
Creates and returns a new Query that starts at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters
snapshot:DocumentSnapshot — The snapshot of the document to start at.
|
Query — The created Query
|
where | () | method |
public function where(filter:Filter):Query
Creates and returns a new Query with the additional filter.
Parameters
filter:Filter — The new filter to apply to the existing query.
|
Query — The created Query
|
whereEqualTo | () | method |
public function whereEqualTo(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be equal to the specified value.
Parameters
field:String — The name of the field to compare
| |
value:Object — The value for comparison
|
Query — The Query instance for chaining calls
|
whereGreaterThan | () | method |
public function whereGreaterThan(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be greater than the specified value.
Parameters
field:String — The name of the field to compare
| |
value:Object — The value for comparison
|
Query — The Query instance for chaining calls
|
whereGreaterThanOrEqualTo | () | method |
public function whereGreaterThanOrEqualTo(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be greater than or equal to the specified value.
Parameters
field:String — The name of the field to compare
| |
value:Object — The value for comparison
|
Query — The Query instance for chaining calls
|
whereLessThan | () | method |
public function whereLessThan(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than the specified value.
Parameters
field:String — The name of the field to compare
| |
value:Object — The value for comparison
|
Query — The Query instance for chaining calls
|
whereLessThanOrEqualTo | () | method |
public function whereLessThanOrEqualTo(field:String, value:Object):Query
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than or equal to the specified value.
Parameters
field:String — The name of the field to compare
| |
value:Object — The value for comparison
|
Query — The Query instance for chaining calls
|
query:error | Event |
com.distriqt.extension.firebase.firestore.events.QueryEvent
com.distriqt.extension.firebase.firestore.events.QueryEvent.ERROR
Dispatched when an error occurred during the query or if there was an issue with the query parameters. Check the
message
for information on the error.
query:snapshot:event | Event |
com.distriqt.extension.firebase.firestore.events.QueryEvent
com.distriqt.extension.firebase.firestore.events.QueryEvent.SNAPSHOT_EVENT
Dispatched when the data of the document changes
query:success | Event |
com.distriqt.extension.firebase.firestore.events.QueryEvent
com.distriqt.extension.firebase.firestore.events.QueryEvent.SUCCESS
Dispatched when the query was successful and the
snapshot
will contain the query results.