firestore.DocumentBuilder class

Signature:

exportdeclareclassDocumentBuilder<Pathextendsstring>

Constructors

ConstructorModifiersDescription
(constructor)(triggerResource, options)Constructs a new instance of theDocumentBuilder class

Methods

MethodModifiersDescription
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

ParameterTypeDescription
triggerResource() => string
optionsDeploymentOptions

firestore.DocumentBuilder.onCreate()

Respond only to document creations.

Signature:

onCreate(handler:(snapshot:QueryDocumentSnapshot,context:EventContext<ParamsOf<Path>>)=>PromiseLike<any>|any):CloudFunction<QueryDocumentSnapshot>;

Parameters

ParameterTypeDescription
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

ParameterTypeDescription
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

ParameterTypeDescription
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

ParameterTypeDescription
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.