【发布时间】:2019-06-04 21:25:12
【问题描述】:
我有一个名为“用户”的集合。我正在尝试在 Google 身份验证后将用户添加到集合中,但我不断收到以下错误:
FirebaseError:[code=invalid-argument]:文档引用无效。文档引用必须有偶数个段,但用户有 1 个。
这里是代码
this.googlePlus.login({
'scopes': '',
'webClientId': environment.googleWebClientId,
'offline': true,
})
.then(user => {
// save user data on the native storage
const userRef: AngularFirestoreCollection<User> = this.afs.collection<User>(`users/`);
const data: User = {
email: user.email,
displayName: user.displayName,
uid: user.uid
};
userRef.set(data)
.then(() => {
this.router.navigate(['/home']);
【问题讨论】:
标签: firebase ionic-framework firebase-authentication google-cloud-firestore