【问题标题】:Query is responding nothing - firestore javascript查询没有响应 - firestore javascript
【发布时间】:2018-04-11 03:37:26
【问题描述】:

前一天运行良好,但今天早上它只是拒绝前进。

Firestore 查询没有响应,没有错误,没有响应。

即使在控制台中,phone 也可以正常打印。它也存在于db中。它在前一天工作得非常好。

db.collection('users').where('mobile_no', '==', phone).limit(1).get().then(function(userSnapshot){
    if (userSnapshot.size > 0) {
      userSnapshot.forEach(doc => {
          console.log("EMAIL DATA:"+JSON.stringify(doc.data()));
          if (doc.data().email == '-' || doc.data().email == undefined || doc.data().email == '') {

            thisclass.setState({
              stateReady: true
            })
            // window.location = '/dashboard'
          }else{
            if (fire.auth().currentUser.emailVerified) {
                thisclass.setState({
                  isEmail: true,
                  stateReady: true,
                  emailVerified: true
                })
                //window.location = '/dashboard'
            }else{
                thisclass.setState({
                  isEmail: true,
                  stateReady: true,
                  emailVerified: false
                })
            }

          }
      })

    }else{
      console.log("USER IN Dashboard NOt Exist");

    }
}).catch(function(error){
  console.log("ERROR:"+error);
})

它没有显示 snapShot.size ,没有 doc.data() 也没有 errors 似乎查询没有运行完全没有。

可能出了什么问题?

我正在使用带有 firebase 的 reactjs

【问题讨论】:

  • 你有什么改变吗?
  • 不,我没有改变任何东西。
  • 尝试查看浏览器开发者控制台中的请求选项卡。看看有没有什么让你印象深刻的(例如那些没有通过的)。
  • Firebase 也为我关闭了

标签: javascript reactjs firebase google-cloud-firestore


【解决方案1】:

它现在可以工作了,上面的代码相同。似乎火力基地已关闭。但他们没有提到火力基地状态。 (当我发布这个问题时,一切都已启动并处于运行状态)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-06
    • 2018-08-18
    • 2021-10-28
    • 1970-01-01
    相关资源
    最近更新 更多