From 7ecbd431a943a8ae6e6c7cc653703cb0f80df0b7 Mon Sep 17 00:00:00 2001 From: Yuchen Shi Date: Fri, 5 Apr 2019 13:33:58 -0700 Subject: [PATCH] s/Realtime Database/Cloud Firestore in comments. --- quickstarts/uppercase-firestore/functions/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickstarts/uppercase-firestore/functions/index.js b/quickstarts/uppercase-firestore/functions/index.js index 0fdc0e9ff5..8e6fdbc7ee 100644 --- a/quickstarts/uppercase-firestore/functions/index.js +++ b/quickstarts/uppercase-firestore/functions/index.js @@ -20,14 +20,14 @@ // The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers. const functions = require('firebase-functions'); -// The Firebase Admin SDK to access the Firebase Realtime Database. +// The Firebase Admin SDK to access the Cloud Firestore. const admin = require('firebase-admin'); admin.initializeApp(); // [END import] // [START addMessage] // Take the text parameter passed to this HTTP endpoint and insert it into the -// Realtime Database under the path /messages/:documentId/original +// Cloud Firestore under the collection 'messages'. // [START addMessageTrigger] exports.addMessage = functions.https.onRequest((req, res) => { // [END addMessageTrigger] @@ -51,13 +51,13 @@ exports.makeUppercase = functions.firestore.document('/messages/{documentId}') .onCreate((snap, context) => { // [END makeUppercaseTrigger] // [START makeUppercaseBody] - // Grab the current value of what was written to the Realtime Database. + // Grab the current value of what was written to the Cloud Firestore. const original = snap.data().original; console.log('Uppercasing', context.params.documentId, original); const uppercase = original.toUpperCase(); // You must return a Promise when performing asynchronous tasks inside a Functions such as - // writing to the Firebase Realtime Database. - // Setting an 'uppercase' sibling in the Realtime Database returns a Promise. + // writing to the Cloud Firestore. + // Setting an 'uppercase' field in the Cloud Firestore document returns a Promise. return snap.ref.set({uppercase}, {merge: true}); // [END makeUppercaseBody] });