Packagecom.tuarua.firebase.firestore
Classpublic class DocumentReference
InheritanceDocumentReference Inheritance Object



Public Properties
 PropertyDefined By
  parent : CollectionReference
[read-only] A reference to the collection to which this DocumentReference belongs.
DocumentReference
  path : String
[read-only]
DocumentReference
Public Methods
 MethodDefined By
  
DocumentReference(path:String)
Returns a DocumentReference pointing to a new document with an auto-generated ID.
DocumentReference
  
addSnapshotListener(listener:Function):void
Attaches a listener for DocumentSnapshot events.
DocumentReference
  
collection(collectionPath:String):CollectionReference
DocumentReference
  
getDocument(listener:Function):void
Reads the document referenced by this DocumentReference.
DocumentReference
  
map(to:Class):void
Converts the Document into an as3 Class with properties mapped to the Document's fields.
DocumentReference
  
remove(listener:Function = null):void
Deletes the document referred to by this DocumentReference.
DocumentReference
  
removeSnapshotListener(listener:Function):void
Detaches a listener for DocumentSnapshot events.
DocumentReference
  
setData(data:*, listener:Function = null, merge:Boolean = false):void
Writes to the document referred to by this DocumentReference.
DocumentReference
  
updateData(data:*, listener:Function = null):void
Updates fields in the document referred to by this DocumentReference.
DocumentReference
Property Detail
parentproperty
parent:CollectionReference  [read-only]

A reference to the collection to which this DocumentReference belongs.


Implementation
    public function get parent():CollectionReference
pathproperty 
path:String  [read-only]


Implementation
    public function get path():String
Constructor Detail
DocumentReference()Constructor
public function DocumentReference(path:String)

Returns a DocumentReference pointing to a new document with an auto-generated ID.

Parameters
path:String
Method Detail
addSnapshotListener()method
public function addSnapshotListener(listener:Function):void

Attaches a listener for DocumentSnapshot events.

Parameters

listener:Function — Optional Function to be called on completion. The function is expected to have the following signature:
     function callback(snapshot:DocumentSnapshot, error:FirestoreError, realtime:Boolean):void {
     
     }
     

collection()method 
public function collection(collectionPath:String):CollectionReference

Parameters

collectionPath:String

Returns
CollectionReference — A CollectionReference pointing to the document at the specified path
getDocument()method 
public function getDocument(listener:Function):void

Reads the document referenced by this DocumentReference.

Parameters

listener:Function — Optional Function to be called on completion. The function is expected to have the following signature:
     function callback(snapshot:DocumentSnapshot, error:FirestoreError, realtime:Boolean):void {
     
     }
     

map()method 
public function map(to:Class):void

Converts the Document into an as3 Class with properties mapped to the Document's fields.

Parameters

to:Class — AS3 class to map to

remove()method 
public function remove(listener:Function = null):void

Deletes the document referred to by this DocumentReference.

Parameters

listener:Function (default = null)

removeSnapshotListener()method 
public function removeSnapshotListener(listener:Function):void

Detaches a listener for DocumentSnapshot events.

Parameters

listener:Function

setData()method 
public function setData(data:*, listener:Function = null, merge:Boolean = false):void

Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created.

Parameters

data:*
 
listener:Function (default = null) — Optional Function to be called on completion. The function is expected to have the following signature:
     function callback(path:String, error:FirestoreError):void {
     
     }
     
 
merge:Boolean (default = false)

updateData()method 
public function updateData(data:*, listener:Function = null):void

Updates fields in the document referred to by this DocumentReference. If the document does not exist, the update fails and the specified completion block receives an error.

Parameters

data:*
 
listener:Function (default = null) — Optional Function to be called on completion. The function is expected to have the following signature:
     function callback(path:String, error:FirestoreError):void {
     
     }