Firestore Trigger Functions

Equivalent of - https://firebase.google.com/docs/functions/firestore-events

onCreate trigger:

functions:
- name: myFirestoreOnCreateFunction
type: firestore
trigger: onCreate
# NOTE: If you leave out the field 'createDoc' the function will be loaded
# but won't automatically trigger on each run.
# The 'createDoc' field creates a new specified document
# that will trigger this firestore function.
# Keep in mind that this document will actually be
# create in the emulated Firestore!
createDoc:
collection: path/to/collection
id: new-doc-id
data: '{}'
# You can also reference a document from your production
# Firestore database.
# This document will be copied to the emulated Firestore
# database and will trigger this function.
createDoc:
getFromProd:
collection: path/to/collection
id: existing-doc-id

onDelete trigger:

functions:
- name: myFirestoreOnDeleteFunction
type: firestore
trigger: onDelete
# NOTE: If you leave out the field 'deleteDoc' the function will be loaded
# but won't automatically trigger on each run.
# The 'deleteDoc' field deletes a specified document from
# the emulated Firestore database. The deletion will
# trigger this firestore function.
# Keep in mind that this document will actually be
# deleted from the emulated Firestore database. So it must
# exist first!
deleteDoc:
# A document inside this collection must exist in the
# emulated Firestore database
collection: path/to/collection
id: existing-doc-id

onUpdate trigger:

functions:
- name: myFirestoreOnUpdateFunction
type: firestore
trigger: onUpdate
# NOTE: If you leave out the field 'updateDoc' the function will be loaded
# but won't automatically trigger on each run.
# The 'updateDoc' field updates a specified document
# from the emulated Firestore database with a new
# data. The update will trigger this firestore function.
# Keep in mind that this document will actually be
# updated in the emulated Firestore database. So it must
# exist first!
updateDoc:
collection: path/to/collection
id: existing-doc-id
# A JSON string specifying new document's data
data: '{}'

onWrite trigger:

functions:
- name: myFirestoreOnWriteFunction
type: firestore
trigger: onWrite
# NOTE: If you omit the following fields the function will be loaded
# but won't automatically trigger on each run.
# Use one of 'createDoc', 'updateDoc', or 'deleteDoc'
createDoc:
# The same syntax as you would use with an onCreate function.
...
updateDoc:
# The same syntax as you would use with an onUpdate function
...
deleteDoc:
# The same syntax as you would use with an onDelete function
...