Packagecom.distriqt.extension.firebase.firestore
Interfacepublic interface CollectionReference extends Query, flash.events.IEventDispatcher



Public Methods
 MethodDefined By
  
Adds a new document to this collection with the specified POJO as contents, assigning it a document ID automatically.
CollectionReference
  
Use this function to add a failure handler callback for the add() method.
CollectionReference
 Inherited
Use this function to add a failure handler callback for the query() method.
Query
 Inherited
Use this function to add a success handler callback for the query() method.
Query
  
Use this function to add a success handler callback for the add() method.
CollectionReference
 Inherited
addSnapshotListener(listener:Function, metadataChanges:int):void
Starts listening to this query.
Query
  
document(documentPath:String = null):DocumentReference
Gets a DocumentReference instance that refers to the document at the specified path within this collection.
CollectionReference
 Inherited
endAt(... fieldValues):Query
Creates and returns a new Query that ends at the provided fields relative to the order of the query.
Query
 Inherited
Creates and returns a new Query that ends at the provided document (inclusive).
Query
 Inherited
endBefore(... fieldValues):Query
Creates and returns a new Query that ends before the provided fields relative to the order of the query.
Query
 Inherited
Creates and returns a new Query that ends before the provided document (exclusive).
Query
  
getId():String
The ID of the collection
CollectionReference
  
Gets a DocumentReference to the document that contains this collection.
CollectionReference
  
getPath():String
Gets the path of this collection (relative to the root of the database) as a slash-separated string.
CollectionReference
 Inherited
limit(limit:int):Query
Creates and returns a Query that's additionally limited to only return up to the specified number of documents.
Query
 Inherited
orderBy(field:String, direction:int):Query
Creates and returns a new Query that's additionally sorted by the specified field.
Query
 Inherited
query(source:String):Query
Perform a query to retrieve the documents in this collection.
Query
 Inherited
removeSnapshotListener(listener:Function):void
Stops listening to this query.
Query
 Inherited
startAfter(... fieldValues):Query
Creates and returns a new Query that starts after the provided fields relative to the order of the query.
Query
 Inherited
Creates and returns a new Query that starts after the provided document (exclusive).
Query
 Inherited
startAt(... fieldValues):Query
Creates and returns a new Query that starts at the provided fields relative to the order of the query.
Query
 Inherited
Creates and returns a new Query that starts at the provided document (inclusive).
Query
 Inherited
Creates and returns a new Query with the additional filter.
Query
 Inherited
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
 Inherited
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
 Inherited
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
 Inherited
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
 Inherited
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
Events
 Event Summary Defined By
   CollectionReference
   CollectionReference
Method Detail
add()method
public function add(pojo:Object):CollectionReference

Adds a new document to this collection with the specified POJO as contents, assigning it a document ID automatically.

Parameters

pojo:Object — The POJO that will be used to populate the contents of the document

Returns
CollectionReference
addOnFailureListener()method 
public function addOnFailureListener(handler:Function):CollectionReference

Use this function to add a failure handler callback for the add() method.

The handler function will be called if the add 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

Returns
CollectionReference — The CollectionReference instance for chaining calls
addOnSuccessListener()method 
public function addOnSuccessListener(handler:Function):CollectionReference

Use this function to add a success handler callback for the add() method.

The handler function will be called if the add call was successful and will contain the document reference created as the first parameter.

Parameters

handler:Function — The handler function called when an success occurs, should take one DocumentReference parameter

Returns
CollectionReference — The CollectionReference instance for chaining calls
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 no path is provided (null) this will return 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. If null a document with an automatically generated id will be returned.

Returns
DocumentReference — The _DocumentReference instance
getId()method 
public function getId():String

The ID of the collection

Returns
String — The ID of the collection
getParent()method 
public function getParent():DocumentReference

Gets a DocumentReference to the document that contains this collection. Only subcollections are contained in a document. For root collections, returns null.

Returns
DocumentReference — The parent DocumentReference or null if this is a root collection
getPath()method 
public function getPath():String

Gets the path of this collection (relative to the root of the database) as a slash-separated string.

Returns
String — The path of this collection
Event Detail
add:error Event
Event Object Type: com.distriqt.extension.firebase.firestore.events.CollectionReferenceEvent
CollectionReferenceEvent.type property = com.distriqt.extension.firebase.firestore.events.CollectionReferenceEvent.ADD_ERROR

add:success Event  
Event Object Type: com.distriqt.extension.firebase.firestore.events.CollectionReferenceEvent
CollectionReferenceEvent.type property = com.distriqt.extension.firebase.firestore.events.CollectionReferenceEvent.ADD_SUCCESS