【发布时间】:2019-12-08 13:45:28
【问题描述】:
我在所有文档的 firestore 中添加了一些数组,但显示错误
core.js:6014 ERROR FirebaseError: Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: an array
我有一个数组,我需要将它保存在所有文档中。所以首先获取所有文档 ID,然后在所有文档中保存数组,但这里显示错误是我的代码。
getAllDocs(seen){
this.angularFirestore.collection("HomeGroup").snapshotChanges().pipe(
map(changes=>{
return changes.map(a=>{
const data = a.payload.doc.data();
const id = a.payload.doc.id;
return {id}
});
}
)).subscribe(items=>{
console.log(items);
this.ids = items;
this.angularFirestore.collection('HomeGroup').doc(this.ids).add(seen);
})
}
它认为问题出在 ids 上?
【问题讨论】:
标签: angular firebase ionic-framework google-cloud-firestore