Map remove and map put (same index)

#1

Hello!

We have some problems with using map keys on Aerospike. First we put 4 items in map key.

Key1-Value1 - index 0

Key2-Value2 - index 1

Key3-Value3 - index 2

Key4-Value4 - index 3

Next we remove map key-value by index 0. So now we have this one:

Key2-Value2 - index 0

Key3-Value3 - index 1

Key4-Value4 - index 2

Next we add new key-value with same keys and values: Key1-Value1 So we want to see this one:

Key2-Value2 - index 0

Key3-Value3 - index 1

Key4-Value4 - index 2

Key1-Value1 - index 3

But on aerospike we have (!!!) this one:

Key1-Value1 - index 0

Key2-Value2 - index 1

Key3-Value3 - index 2

Key4-Value4 - index 3

Why so? Whats the problem? I need to use mapkeys and not list one.

#2

Maps are always ordered by ‘key’. Index 0 will always be the lowest key. If you need insertion order, you will need to use a list.