javascript - 如何获得子收藏电子邮件
问题描述
所以我目前正在尝试访问我访问的电子邮件。它只打印完整的字符串,但我完全不确定如何获取电子邮件
function addLead() {
db.collection('entities')
.doc('0') // change to the current user id
.get().then((user)=>{
if(user.exists){
// now you can do something with user
console.log(user.data())
}
});
};
addLead();
它打印出这个:
{ email: '123googlemail.com', user: 'X', pass: 'XD' }
每次我收到这封电子邮件并使用它时,我都希望它选择下一个 ID,即“1”
所以它会转到“entities/0/email”,然后一旦使用就转到“entities/1/email”等
希望有人能帮忙
解决方案
所以我想通了,你必须使用正常的过程,但将(doc)传递给一个函数:
db.collection('entities').doc("0").get().then(function(doc) {
const passName = doc.data().pass;
console.log(doc.data().pass);
希望这会帮助任何被卡住的人,它进入实体,打开它,找到具有 ID 的人,0
然后获取详细信息。
推荐阅读
- c++ - 如何实现内联显式类的构造函数?
- c# - 改变玩家位置后无法移动
- javascript - 如何使用带有 body 标签的 document.getElementByTagName()
- nservicebus - 从 4.0.1 到 4.1.0 的特定 ServiceControl 更新问题,审核不更新
- python-3.x - 如果名称为成对括号,则无法找到带有 glob.glob 的文件
- django - 在 django 中按用户名搜索用户
- bixby - 使用循环数组连接内容
- c# - C# 中断 WaitForChanged 事件
- mongodb - $concatArrays 不适用于现有的多数组字段
- angular - 角度文件保护程序 - 部署后看不到本地保存的文件