【发布时间】:2021-02-20 22:08:20
【问题描述】:
我的 Angular Web 应用在 Firebase 中有一个 Firestore 数据库。现在我正在尝试在我的集合“用户”中创建新文档。我知道如何创建这些,但只能使用简单的字段(“邮件、昵称和用户 ID”)。我还想在此文档中添加一个子集合“路由”,但我不知道如何。这个子集合中会有文档。
这是我在 Firebase 中的数据库的照片: https://i.stack.imgur.com/3nZMn.png
这是我用来在这个数据库中创建一个新用户的函数。它正在工作,但缺少子集合。
create_new_User(docID, email, nickname, userID) {
return this.fireservices.collection('users').doc(docID).set({
mail: email,
nickname: nickname,
userID: userID
});
}
有人想解决这个问题吗?
【问题讨论】:
标签: angular firebase google-cloud-firestore collections