Method | Defined By | ||
---|---|---|---|
Creates a new write batch | WriteBatch | ||
commit(listener:Function = null):void
Commits all of the writes in this write batch as a single atomic unit. | WriteBatch | ||
deleteDocument(documentReference:DocumentReference):void
Deletes the document referred to by documentReference. | WriteBatch | ||
setData(data:*, forDocument:DocumentReference, merge:Boolean = false):void
Writes to the document referred to by documentReference. | WriteBatch | ||
updateData(data:*, forDocument:DocumentReference):void
Updates fields in the document referred to by documentReference. | WriteBatch |
WriteBatch | () | Constructor |
public function WriteBatch()
Creates a new write batch
commit | () | method |
public function commit(listener:Function = null):void
Commits all of the writes in this write batch as a single atomic unit.
Parameters
listener:Function (default = null ) — Optional This function will only execute
when the client is online and the commit has completed against the server. The
completion handler will not be called when the device is offline, though local
changes will be visible immediately.
The function is expected to have the following signature:
function callback(error:FirestoreError):void { } |
deleteDocument | () | method |
public function deleteDocument(documentReference:DocumentReference):void
Deletes the document referred to by documentReference
.
Parameters
documentReference:DocumentReference |
setData | () | method |
public function setData(data:*, forDocument:DocumentReference, merge:Boolean = false):void
Writes to the document referred to by documentReference
. If the document doesn't yet exist,
this method creates it and then sets the data. If the document exists, this method overwrites
the document data with the new values.
Parameters
data:* | |
forDocument:DocumentReference — A reference to the document whose data should be overwritten.
| |
merge:Boolean (default = false ) — Whether to merge the provided data into any existing document.
|
updateData | () | method |
public function updateData(data:*, forDocument:DocumentReference):void
Updates fields in the document referred to by documentReference
.
If document does not exist, the write batch will fail.
Parameters
data:* — A reference to the document whose data should be overwritten.
| |
forDocument:DocumentReference |