I am new to firebase and is stuck in database query. I am using Firebase in my Unity game. Here is my sample database structure:
My rules are:
{
"rules": {
".read": "auth != null",
".write":"auth != null",
"matches": {
".indexOn": "matchTypeStr"
}
}
}
and I am querying like this:
Query searchQuery = FirebaseDatabase.DefaultInstance.RootReference.Child("matches").OrderByChild("matchTypeStr").EqualTo("kMatchEmail")
.LimitToFirst(10);
searchQuery.GetValueAsync().ContinueWith(delegate(Task<DataSnapshot> task) {
});
The problem is that query never executes, it does not come inside the completion block. If I remove the rules, it works fine but it turns off indexing and I get the following warning:
PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "matchTypeStr"' at matches to your security and Firebase Database rules for better performance
I am unable to find my fault. Any help would be greatly appreciated.
