Forum BigDB Bug: Indexing on String vs. Long for large numbers

Discussion and help relating to Player.IO's database solution, BigDB.

Bug: Indexing on String vs. Long for large numbers

Postby cjcenizal » October 21st, 2011, 8:28 pm

I recently tried to create an index on my PlayerObject table using a user's Facebook ID (which is stored as an object property). These IDs are completely numerical, and up to 15 digits in length. How many digits can be stored in a long? Building the index as a long on this 15-digit FB ID doesn't work (the index never seems to build). Building it as a string works fine, though. Is this expected behavior?
cjcenizal
Paid Member
 
Posts: 116
Joined: March 29th, 2011, 12:31 am

Re: Bug: Indexing on String vs. Long for large numbers

Postby Oliver » November 7th, 2011, 4:00 pm

That is because you've saved the value (from flash probably) as a string. It's a string with a numeric value, like this: "12345". We don't try to auto-cast values from one data type to another, so you have to be sure to store values in the right type.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1136
Joined: January 12th, 2010, 8:29 am

Re: Bug: Indexing on String vs. Long for large numbers

Postby cjcenizal » November 7th, 2011, 6:07 pm

Ah, that makes sense. Thanks, Oliver.
cjcenizal
Paid Member
 
Posts: 116
Joined: March 29th, 2011, 12:31 am


Return to BigDB



cron