Package | com.myflashlab.air.extensions.firebase.firestore |
Class | public class CollectionReference |
Inheritance | CollectionReference Query flash.events.EventDispatcher |
Property | Defined By | ||
---|---|---|---|
collectionId : String [read-only]
The ID of the collection. | CollectionReference | ||
parent : DocumentReference [read-only]
Gets a DocumentReference to the document that contains this collection. | CollectionReference | ||
path : String [read-only]
Gets the path of this collection (relative to the root of the database) as a slash-separated string. | CollectionReference |
Method | Defined By | ||
---|---|---|---|
add($data:Object):void
Adds a new document to this collection with the specified data, assigning it a document ID automatically. | CollectionReference | ||
addEventListener($type:String, $listener:Function, $useCapture:Boolean = false, $priority:int = 0, $useWeakReference:Boolean = false):void [override] | Query | ||
addSnapshotListener($onSuccess:Function, $onFailure:Function, $metadataChanges:String = null):void
Starts listening to this query with the given options (options can be null). | Query | ||
document($documentPath:String = null):DocumentReference
Gets a DocumentReference instance that refers to the document at the specified path within this collection. | CollectionReference | ||
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 before the provided fields relative to the order of the query. | Query | ||
Creates and returns a new Query that's additionally limited to only return up to the specified number of
documents. | Query | ||
limitToLast($limit:Number):Query
Creates and returns a new { | Query | ||
Creates and returns a new Query that's additionally sorted by the specified field, optionally in descending
order instead of ascending. | Query | ||
read($metadataChanges:String = null, $source:String):void
Executes the query and returns the results in FirestoreEvents.QUERY_GET_FAILURE and
FirestoreEvents.QUERY_GET_SUCCESS
| Query | ||
removeEventListener($type:String, $listener:Function, $useCapture:Boolean = false):void [override] | Query | ||
removeSnapshotListener($onSuccess:Function, $onFailure:Function):void
remove an already registered snapshotListener. | 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 at the provided fields relative to the order of the query. | Query | ||
whereArrayContains($field:String, $value:*):Query
Creates and returns a new Query with the additional filter that documents must contain the specified field, it
must be an array, and the array must contain the provided value. | Query | ||
whereArrayContainsAny($field:String, $values:*):Query
Creates and returns a new { | Query | ||
whereEqualTo($field:String, $value:*):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:*):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:*):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 | ||
Creates and returns a new { | Query | ||
whereLessThan($field:String, $value:*):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:*):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 |
collectionId | property |
collectionId:String
[read-only] The ID of the collection.
public function get collectionId():String
parent | property |
parent:DocumentReference
[read-only] Gets a DocumentReference to the document that contains this collection. Only subcollections are contained in a document. For root collections, returns null.
public function get parent():DocumentReference
path | property |
path:String
[read-only] Gets the path of this collection (relative to the root of the database) as a slash-separated string.
public function get path():String
add | () | method |
public function add($data:Object):void
Adds a new document to this collection with the specified data, assigning it a document ID automatically. Result
will be dispatches with COLLECTION_ADD_SUCCESS
or COLLECTION_ADD_FAILURE
Parameters
$data:Object — An object containing the data for the new document.
|
document | () | method |
public function document($documentPath:String = null):DocumentReference
Gets a DocumentReference instance that refers to the document at the specified path within this collection. If the document path is not provided, it returns a DocumentReference pointing to a new document with an auto-generated ID within this collection.
Parameters
$documentPath:String (default = null ) — A slash-separated relative path to a document.
|
DocumentReference — The DocumentReference instance.
|