June 2018
Beginner to intermediate
394 pages
9h 2m
English
Functions for Firestore offer another function, called onDelete(). This takes a wildcard as a parameter and deletes the appropriate document:
exports.deleteUser = functions.firestore .document('users/{userID}') .onDelete(event => { // e.g. {'name': 'Srinivas', 'age': 61} var deletedValue = event.data.previous.data(); // perform desired operations ... });
This code fetches the value deleted from the Firestore and we could perform an action based on this data.
Read now
Unlock full access