【发布时间】:2019-11-29 09:51:46
【问题描述】:
我需要将文档 ID 保存在集合中。意味着当用户保存数据时,它也会将文档 ID 与数据一起保存。谁能告诉我该怎么做。谢谢:)
create() {
// the user details are updated in firebase user list
this.groupDetails = {
groupname: this.Name,
description: this.description,
members: this.checked,
messages: [],
createdId: this.user.userId,
createrName: this.user.username
}
console.log(this.groupDetails);
// details are submitted to creatGroup function from groupProvider
this.messageService.createGroup(this.groupDetails).then(resp => {
console.log(resp);
this.toast.show("Group Created");
this.router.navigate(["/home"]);
});
}
createGroup(groupDetails) {
return this.angularFirestore.collection('Groups').add(groupDetails);
}
【问题讨论】:
标签: angular ionic-framework google-cloud-firestore