I have spent hours trying to loadRange from the server, but receive constant errors. I followed the examples verbatim (literatim, codeatim? ), over and over again, and even tried my own, but still no success. I can loadSingle without any issues, but loadRange, having an issue every single time. I also enabled all rights in the admin panel when creating the table, just for testing purposes.
I will start with the example playerIO has for doing a simple loadRange. I have the proper index and properties in BigDB, and am trying to use this code per the playerIO serverside example:
- Code: Select all
//Load all users from Paris that are 30 years old, and were created in April
PlayerIO.BigDB.LoadRange("Users", "ByLocationAgeCreated",
new object[]{"Paris", 30}, new DateTime(2011, 8, 1),
new DateTime(2011, 8, 29), 10,
delegate(DatabaseObject[] result) { Console.WriteLine(result); });
Error: Error: Webservice returned unhandled error: InvalidIndexValue
The start index value of property created is smaller than the stop value
So then I reverse the order, not like that should matter, since the start value should be smaller, obviously. This time the server writes in the Console the following:
"PlayerIO.ServerCore.PlayerIOClient.DatabaseObjectImpl[]"
So the example doesn't work as it should. Prior to trying this, I set up my own very simple table, index and properties, trying to loadRange nearly the same way. First I created an object from the server, and filled in my properties:
- Code: Select all
var date = DateTime.Now.Date;
DatabaseObject obj = new DatabaseObject();
obj.Set("datecreated", date);
obj.Set("username", player.ConnectUserId);
obj.Set("notunique", "vinceAS3");
PlayerIO.BigDB.CreateObject("UserTest", null, obj, null);
I repeat this process one time, so I have a different user, two users in all with their own properties filled in.
Filled it in nicely on BigDB as you can see from this screenshot. I didn't include the other user, just to keep it simple. Also, I am using DateTime:
So now, I am going to try to loadRange it from the server using this code:
- Code: Select all
PlayerIO.BigDB.LoadRange("UserTest", "UserInfo", new object[] { "vinceAS3" }, new DateTime(2011, 08, 15), new DateTime(2011, 08, 29), 10, delegate(DatabaseObject[] result) { Console.WriteLine(result); });
Error: Error: Webservice returned unhandled error: InvalidIndexValue
The index 'UserInfo' value no. 1 (index 0) must be of type: DateTime
So it wants me to make it Date? No problem. I go back into BigDB and change the property "datecreated" to type "Date" rather than "DateTime" as you can see in this screenshot:
I save, and wait until the index is finished building.
I then use the same code, and try to loadRange again:
Error: Error: Webservice returned unhandled error: InvalidIndexValue
The index 'UserInfo' value no. 1 (index 0) must be of type: Date
So, it doesn't care if I have it set properly as Date or DateTime. If I have it set as Date, it tells me that it must be type DateTime. If I set the type as DateTime, it tells me that it must be of type Date.
What is the issue? BigDB having issues or is this user error?
Thanks.