0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cloud Functions

Last updated at Posted at 2020-01-24

いろいろメモ

テスト

トリガーとなるイベント

ダメなテストデータの書き方

前提:firebaseを使って実行するFunctions

index.ts
export const setUser = functions.https.onCall((data) => {
    const collection = firebase.firestore(app).collection('Users');
    const docRef = collection.doc(data.userCode);
    docRef.set({firstName:data.firstName});
    return {Message : 'Users Set Success!'}
});

ダメだったテストデータ

TestData
{"userCode":"20","firstName":"asada"}

OKだったテストデータ

TestData
{"data":{"userCode":"20","firstName":"asada"}}

最後に

jsonの最上部は「data」でした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?