Closed1

Cloud Functions でのFirestoreのデータの取り出し方

まった | maztak.ethまった | maztak.eth

Cloud Funtions で Firestore のデータを取ってくる時、data().uidという記述とdata()["uid"]という記述の両方をみます。クライアント側の言語のSwiftなどでは後者の書き方しか通じないようなんですが、Cloud Functions 側ではどっちでも使えるよって認識でいいんでしょうか?

exports.createUser = functions.firestore
    .document('users/{userId}')
    .onCreate((snap, context) => {
      // e.g. {'name': 'Marie', 'age': 66}
      const newValue = snap.data();
      const name = newValue.name;
    });

https://firebase.google.com/docs/functions/firestore-events?hl=ja#event_triggers

このスクラップは2021/05/24にクローズされました