After finishing up a project, we realised that we needed to have rules to make it secure. So we denormalised the realtime database
"users" :{
".read":"auth != null",
"$companyId":{
"$managedby":{
".indexOn": "mobile"
}
}
},
So that is the new firebase rule we have. Now even after adding the index on mobile I get this warning:
util.js:233 FIREBASE WARNING: Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ".indexOn": "mobile" at /users to your security rules for better performance.
I am also trying to get data from the same node using :
return this.afDB.database.ref('users').orderByChild('mobile').equalTo(mobilenum); ( I use Angular)
The same code should work because it worked earlier, only thing now is that we are two levels deep. If I remove the orderByChild part, I download all the users. So where is the problem?
The mobilenum variable datatype is a string which matches that of the database.