firestore.DocumentBuilder class Stay organized with collections Save and categorize content based on your preferences.
Signature:
exportdeclareclassDocumentBuilder<Pathextendsstring>Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(triggerResource, options) | Constructs a new instance of theDocumentBuilder class |
Methods
| Method | Modifiers | Description |
|---|---|---|
| onCreate(handler) | Respond only to document creations. | |
| onDelete(handler) | Respond only to document deletions. | |
| onUpdate(handler) | Respond only to document updates. | |
| onWrite(handler) | Respond to all document writes (creates, updates, or deletes). |
firestore.DocumentBuilder.(constructor)
Constructs a new instance of theDocumentBuilder class
Signature:
constructor(triggerResource:()=>string,options:DeploymentOptions);Parameters
| Parameter | Type | Description |
|---|---|---|
| triggerResource | () => string | |
| options | DeploymentOptions |
firestore.DocumentBuilder.onCreate()
Respond only to document creations.
Signature:
onCreate(handler:(snapshot:QueryDocumentSnapshot,context:EventContext<ParamsOf<Path>>)=>PromiseLike<any>|any):CloudFunction<QueryDocumentSnapshot>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (snapshot:QueryDocumentSnapshot, context:EventContext<ParamsOf<Path>>) => PromiseLike<any> | any |
Returns:
CloudFunction<QueryDocumentSnapshot>
firestore.DocumentBuilder.onDelete()
Respond only to document deletions.
Signature:
onDelete(handler:(snapshot:QueryDocumentSnapshot,context:EventContext<ParamsOf<Path>>)=>PromiseLike<any>|any):CloudFunction<QueryDocumentSnapshot>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (snapshot:QueryDocumentSnapshot, context:EventContext<ParamsOf<Path>>) => PromiseLike<any> | any |
Returns:
CloudFunction<QueryDocumentSnapshot>
firestore.DocumentBuilder.onUpdate()
Respond only to document updates.
Signature:
onUpdate(handler:(change:Change<QueryDocumentSnapshot>,context:EventContext<ParamsOf<Path>>)=>PromiseLike<any>|any):CloudFunction<Change<QueryDocumentSnapshot>>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (change:Change<QueryDocumentSnapshot>, context:EventContext<ParamsOf<Path>>) => PromiseLike<any> | any |
Returns:
CloudFunction<Change<QueryDocumentSnapshot>>
firestore.DocumentBuilder.onWrite()
Respond to all document writes (creates, updates, or deletes).
Signature:
onWrite(handler:(change:Change<DocumentSnapshot>,context:EventContext<ParamsOf<Path>>)=>PromiseLike<any>|any):CloudFunction<Change<DocumentSnapshot>>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (change:Change<DocumentSnapshot>, context:EventContext<ParamsOf<Path>>) => PromiseLike<any> | any |
Returns:
CloudFunction<Change<DocumentSnapshot>>
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-24 UTC.