Forum BigDB Wrong DatabaseArray order

Discussion and help relating to the PlayerIO database solution, BigDB.

Wrong DatabaseArray order

Postby romeoordos » February 18th, 2014, 2:26 pm

I have a DatabaseArray in one of my schemes.

For example it contains such data:

Code: Select all
[0] Some string #1
[1] Some string #2
[2] Some string #3


Then I call RemoveAt on DatabaseObject(dbo) containing that array:
Code: Select all
dbo.GetArray("myArray").RemoveAt(1);


And then sometimes I receive such structure:

Code: Select all
[0] Some string #1
[2] Some string #3


So when I try to iterate this array it says that it's lenght is 2, but it doesn't contains "1" element so iteration fails.

Any suggestions?
romeoordos
Paid Member
 
Posts: 9
Joined: July 27th, 2013, 10:42 am

Re: Wrong DatabaseArray order

Postby Henrik » February 20th, 2014, 6:14 am

This is by design.

If I remember correctly, the Remove() method shuffles all the elements down one index to plug the hole.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to BigDB



cron