Package | com.tuarua.firebase.firestore |
Class | public class DocumentReference |
Inheritance | DocumentReference ![]() |
Property | Defined By | ||
---|---|---|---|
parent : CollectionReference [read-only] A reference to the collection to which this DocumentReference belongs. | DocumentReference | ||
path : String [read-only] | DocumentReference |
Method | Defined 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 |
parent | property |
parent:CollectionReference
[read-only] A reference to the collection to which this DocumentReference
belongs.
public function get parent():CollectionReference
path | property |
path:String
[read-only] public function get path():String
DocumentReference | () | Constructor |
public function DocumentReference(path:String)
Returns a DocumentReference pointing to a new document with an auto-generated ID.
Parameterspath:String |
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 |
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 { } |