【问题标题】:@firebase/database Warning@firebase/数据库警告
【发布时间】:2018-07-09 10:49:12
【问题描述】:

将 Firebase 与 Expo 结合使用时,我收到以下警告

[2018-07-09T10:44:16.148Z] @firebase/数据库: - node_modules/expo/src/Expo.js:21:41 警告 - defaultLogHandler 中的 node_modules/@firebase/logger/dist/index.cjs.js:66:31 - ... 来自框架内部的另外 19 个堆栈帧

  _fetchCoDocs = coId => {
    const rootRef = firebase.database().ref();
    const coDocsRef = rootRef.child(`coDocs`);
    coDocsRef
      .orderByChild("companyId")
      .equalTo(coId)
      .once("value", snap => {
        console.log(snap.val());
        console.log(Object.values(snap.val()));
      });
  };

我可以忽略这个警告吗?它会影响我在生产中的应用吗?

如果可以忽略警告,如何关闭警告?

谢谢

【问题讨论】:

    标签: firebase firebase-realtime-database expo


    【解决方案1】:

    我设法通过在我的 firebase 规则中添加 .onIndex 来消除警告

    【讨论】:

    • 您能否提供更多关于您如何解决该问题的信息?我遇到了同样的问题。
    • 抱歉我的回复晚了。刚看到你的留言。在我的 firebase 规则中,我添加了一个 indexOn 并解决了这个问题。示例如下....希望对您有所帮助 "coData": { ".read": true, ".write": true, ".indexOn": "companyId" },
    猜你喜欢
    • 2021-01-24
    • 1970-01-01
    • 2013-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-14
    • 2017-02-20
    • 1970-01-01
    相关资源
    最近更新 更多