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.– Bruno Coimbra
In case I have to put index (Nombe) in my list ?
– Douglas William
must be something like what you’ve done here
".indexOn": "gameSearching"
, but to the countrysidenombre
.– Bruno Coimbra
I’m new firebase, have some example just from the rule ?
– Douglas William
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.– Bruno Coimbra
Obg worked, I’ll edit the question.
– Douglas William