Hello,
I am using the latest 1.1.2 Unity Firebase SDK and I have run into a problem when querying semi-large data sets.
The dataset consists of about 95,000 entries. Each entry looks something like this:
{
"score": {"1":"704","4":"731","6":"200","8":"871"},
"timestamp":1486647703910,
"total_score":2506,
"user_id":UID
}
And I query the data like this:
int n = 10;
FirebaseDatabase.DefaultInstance.GetReference("highscore").OrderByChild("timestamp").LimitToLast(n).GetValueAsync().ContinueWith(
(task) => {
if (task != null && !task.IsCanceled && !task.IsFaulted && task.IsCompleted) {
Debug.Log(task.Result.ChildrenCount);
foreach (var item in task.Result.Children) {
Debug.Log(item.GetRawJsonValue());
}
}
else {
Debug.Log("Task returned broken");
}
}
);
When I query my database and n is set to 10, everything works fine. I get the 10 latest highscores added to my database and all is well.
However, if I increase the size of n to about 100 or more it stops working. The task will complete and it will enter the first if clause but when logging task.Result.ChildrenCount it says there are 0 children attached to this DataSnapshot.
Am I mis-using GetValueAsync() or am I doing something else wrong when I'm experiencing this behaviour?
I am running Unity 5.5.0f3 and as mentioned Firebase SDK 1.1.2. It is behaving exactly the same when running through the editor as well as on an Android device. Haven't tried iOS.
Best regards,
Johan.