Skip to Content
Serverless Web Applications with React and Firebase
book

Serverless Web Applications with React and Firebase

by Mayur Tanna, Harmeet Singh
April 2018
Intermediate to advanced content levelIntermediate to advanced
284 pages
6h 43m
English
Packt Publishing
Content preview from Serverless Web Applications with React and Firebase

Cloud Firestore Triggers

Using Cloud Firestore Triggers, your Cloud function can listen to the events emitted by Cloud Firestore whenever there is a change in the data on the specified path your function listens to.

At a high level, it works similarly to the Realtime database triggers. You can use the functions.firestore object to listen to the specific events.

It supports four events: create, update, delete, and write, as listed:

  • onWrite(): It triggers when any document is created, updated, or deleted
  • onCreate(): It triggers when a new document is created
  • onUpdate(): It triggers when any value in an existing document is changed
  • onDelete(): It triggers when a document is deleted

If you want to execute a function whenever a specific document ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Web Applications with Firebase

Building Web Applications with Firebase

Gareth Brown
React Native in Action

React Native in Action

nader dabit, Nickie Buckner

Publisher Resources

ISBN: 9781788477413Supplemental Content