use*_*002 11 javascript node.js firebase vue.js google-cloud-firestore
没有关于如何在firestore中的文档中添加子集合的文档,如何使用Web应用程序添加子集合? 甚至尝试过这样但没有奏效.如何使用代码在应用程序中添加子集合?有没有办法做到这一点,或者使用firebase实时数据库会更好?如果是这样,请让我知道如何在firebase中做到这一点,我想添加像这样 我做了这个,但我得到一个这样的错误错误说这个
Jas*_*man 20
如果您更改.set为,您的代码应该可以工作.add.然后,Cloud Firestore将为该文档发布新ID.如果要指定文档ID,则需要执行此操作...
db.collection('users').doc(this.username).collection('booksList').doc(myBookId).set({
password: this.password,
name: this.name,
rollno: this.rollno
})
Run Code Online (Sandbox Code Playgroud)
此页面详细介绍了如何将数据添加到Cloud Firestore
db.collection('users').doc(this.username).collection('booksList').add({
password: this.password,
name: this.name,
rollno: this.rollno
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18855 次 |
| 最近记录: |