【发布时间】:2020-05-25 08:38:37
【问题描述】:
我正在尝试使用一长串空格分隔值更新我的 firestore 数据库,在浏览完文档后,我使用以下代码访问数据库的“已预订”字段:
db.collection("seats")
.get()
.then(function (querySnapshot) {
querySnapshot.forEach(function (doc) {
// doc.data() is never undefined for query doc snapshots
console.log(doc.id, " => ", doc.data().getString("booked"));
});
});
这是我的 firebase 数据库的结构: 我想将字符串连接到这个预订字段,但我什至无法访问它。这样做时出现以下错误:
Uncaught (in promise) TypeError: doc.data(...).getString is not a function
如何访问我的 firestore 数据库中的该字段并将其连接到一些文本。
【问题讨论】:
标签: javascript html jquery firebase google-cloud-firestore