【发布时间】:2020-01-05 19:20:05
【问题描述】:
我想将在集合中创建的 documentId 作为字段/属性作为 docid 存储在同一个文档中。我正在使用 Cloud Firestore。
显示错误“ReferenceError: doc is not defined” 每当我尝试存储 doc.id 时
db.collection("Colleges").doc(user.uid).collection('Internships').doc().set({
CompanyName :this.I_company,
InternshipTitle : this.I_title,
duration: this.duration,
amount:this.I_amount,
week:this.week,
docid: doc.id
})
【问题讨论】:
-
您在存储 doc id 时收到什么错误?
-
"ReferenceError: doc is not defined" 我得到这个错误
标签: javascript firebase google-cloud-firestore