且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

firebase网站-更新找到特定值的数据库

更新时间:2021-07-08 03:36:13

您需要将索引添加到Firebase数据库安全规则中.我建议阅读有关安全规则的Firebase文档,尤其是部分.

You'll need to add an index to your Firebase Database security rules. I recommend reading the Firebase documentation on security rules, specifically the section on indexes.

文档中的第一个示例:

{
  "rules": {
    "dinosaurs": {
      ".indexOn": ["height", "length"]
    }
  }
}

修改为您的数据结构,看起来像这样:

Modified to your data structure, it'll look something like this:

{
  "rules": {
    "divisions": {
      ".indexOn": "index_num"
    }
  }
}