Usa*_*hir 5 javascript node.js firebase google-cloud-firestore
节点.js 代码
const updateLoggedMeetings = function () {
return new Promise((res, rej) => {
let query = store.collection("attendance");
query.get()
.then(data => {
console.log("DATA is ", data._size);
}).catch(err => console.log("SOME ERROR OCCURED IN THEN BLOCK ",err));
res(`blah`);
})
}
Run Code Online (Sandbox Code Playgroud)
我的数据库查询是:
firebase.firestore().collection("attendance")
当我运行此查询时,它返回零结果。但是,当我运行时firebase.firestore().collection("meetings"),它会返回一些结果。我想要实现的是检索attendance集合中所有文档的文档名称。谢谢
由于考勤又嵌套了集合所以不会返回文档。您可以参考这篇文章以更好地理解。你可以这样使用
var attendance =
db.collection('attendance').doc('doc_id') and you will get the logged_meeting
Run Code Online (Sandbox Code Playgroud)
https://firebase.google.com/docs/firestore/data-model
| 归档时间: |
|
| 查看次数: |
2407 次 |
| 最近记录: |