FIREBASE WARNING: Using an unspecified index

Asked

Viewed 241 times

1

I’m getting following error:

FIREBASE WARNING: Using an unspecified index. Consider Adding ". indexOn": "rota" at /motoristas to your security Rules for Better performance

Firebase rules:

{
    "rules": {
        ".read": "true",
        ".write": "true",
        ".indexOn": "gameSearching"
    }
}

my file.ts

initItems(serchQuery="gameSearching") {
return this.afDatabase.list('/motoristas', {
  query: {
    orderByChild: 'rota',
    equalTo: serchQuery
   }
 });
}
  • try to include an index in the rules nombre on the list /motoristas. Apparently this warning is occurring because the query uses a sort in a field that has no indexes.

  • In case I have to put index (Nombe) in my list ?

  • must be something like what you’ve done here ".indexOn": "gameSearching", but to the countryside nombre.

  • I’m new firebase, have some example just from the rule ?

  • In the official doc there is a simple example https://firebase.google.com/docs/database/security/indexing-data. In the title "Indexing with orderByChild". Something like {"rules": {"motoristas": {".indexOn": ["nombre"]}}} along with your other rules must resolve.

  • Obg worked, I’ll edit the question.

Show 1 more comment

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.