【发布时间】:2019-07-03 15:15:43
【问题描述】:
我希望能够获取我刚刚使用 firestore 中的 where 子句查询的文档的文档 ID。这是我目前的一个例子:
db.collection("Users").where('fullname', '==', 'foo bar').limit(5).get()
.then(function (doc)
{
querySnapshot.forEach(function (doc)
{
//find document id
}
}
由此,我希望能够获取我刚刚查询的文档 ID。有什么办法可以做到吗?
提前致谢。
【问题讨论】:
标签: javascript node.js firebase google-cloud-firestore