1
1

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 3 years have passed since last update.

firebase学習中の備忘録

Posted at

firebase勉強中のメモ

//   追加されたドキュメントのIDを知る方法
const res = await db.collection("コレクション名").add({
     //追加するフィールドの内容を記載
   });
//  ドキュメントのIDの表示
console.log(res.id);
//   IDを指定して情報を取得する
const Id = '';
const userData = await db.collection("コレクション名").doc('Id').get();
console.log(userData.data());
// idを指定してデータを更新
await db.collection("コレクション名").doc('Idの指定').set({
    //更新したいフィールドの内容を記載
    });
``

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?