Ad

How Add ".indexOn" In My Security Rules Of Firebase?

i have this warning in my front end

enter image description here

My data in firebase is this:

enter image description here

after basic i have a key, i try with this rule:

{
"rules": {
".read": true,
".write": true,
 "workers": {
    "report":{
   "basic":{
      "$groupid":{
        ".indexOn": "date"
     }}
   }
  }
 }
}

but the warning persist!

how can config the rules in firebase?

Ad

Answer

think that the $groupid is not required, because the error message does not have it:

{
  "rules": {
    ".read": true,
    ".write": true,
    "workers" {
      "report" {
        "basic" {
          ".indexOn": "date"
        }
      }
    }
  }
}

... and consider adding further security rules; these permissions are alike 777 on a web-server.

Ad
source: stackoverflow.com
Ad