{ -6ren">
gpt4 book ai didi

javascript - firebase.firestore().collection ("attendance") 在 firestore 数据库中返回 0 结果

转载 作者:太空宇宙 更新时间:2023-11-03 22:07:11 24 4
gpt4 key购买 nike

[问题已更新]

node.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`);
})
}

并输出屏幕截图 output

我的数据库结构是:

1:考勤采集 attendance collection

2: session 集合 meeting collection

我的数据库查询是:firebase.firestore().collection(“出席”)当我运行此查询时,它返回零结果。但是,当我运行 firebase.firestore().collection("meetings") 时,它会返回一些结果。我想要实现的是检索 attendance 集合中所有文档的文档名称。谢谢

最佳答案

您正在阅读一个集合,其中所有文档都被标记为已删除。

在显示您的出勤情况的屏幕截图中,所有记录均以斜体显示,这意味着它们已被删除,但未删除其子集合。在这种情况下,meetings_logged 子集合可能包含仍然存在的记录,但出席父记录被标记为已删除。因此,当控制台显示考勤记录时,您无法查询考勤集合。

这可能是由于例如在 Cloud Functions 中设置的触发器而发生的。

关于javascript - firebase.firestore().collection ("attendance") 在 firestore 数据库中返回 0 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52273591/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com