【发布时间】:2020-05-28 02:35:09
【问题描述】:
我有两个不同的应用程序;我们称它们为 A 和 B。我使用 Firestore 将其他用户数据存储在一个名为 /users 的集合下。
我有一个云功能,每当用户通过 Google、手册或 Facebook 注册到 users 集合时,它都会汇总数据。
functions.auth.user().onCreate( (user, ctx) => {
//aggregate data in /users
});
问题是我想添加另一个集合,比如说different-users,它只在使用应用程序B时添加。根据Firebase documentation:
您不能直接向用户对象添加其他属性;反而, 您可以将附加属性存储在任何其他存储服务中, 像 Google Cloud Firestore。
鉴于我无法添加额外数据,我应该如何在我的 cloud 函数中区分这些类型的用户?
我错过了什么吗?
【问题讨论】:
标签: firebase google-cloud-firestore firebase-authentication google-cloud-functions