June 2018
Beginner to intermediate
394 pages
9h 2m
English
Functions for Firestore allows developers to use a wildcard to trigger when a new document is created. Whenever a new user created Firestore, the createuser method is called:
exports.createUser = functions.Firestore .document('users/{userId}') .onCreate(event => { // Object referencing to the document // e.g. {'name': 'Patinitha', 'age': 4} var newValue = event.data.data(); // fetching a particular field. var name = newValue.name; // perform any actions ... });
Read now
Unlock full access