Huh? Can you be more clear about what the change was. What is the operation you performed. If you’re quoting PHP code, do it all the way, including for the transitions.
I am doing normal put operation.I am passing an associate array inside that array contains id value. When i call get api my result is getting changed and returning in some unknown order . I think map containing list of items with integer as key is ordering is not guaranteed?
I still don’t see anything wrong. Please post the source code to reproduce the problem.
I see that you create a bin called ‘bin’ whose value is a map with one key, ‘testdatasort’. The value for that key is another map with one key, ‘testsorting’. The value of that key is yet another map, which has three keys: the integers 2348, 3248, 1234. Their values are strings.
What you showed for before and after is exactly the same.
Another strange case i observed is when i do some data serialize and push to aerospike may be aerospike internally again doing serialize. when i deserialize data it is writtening truncated data.
A map, by default, is unsorted. You have the same key-value pairs, but the order isn’t necessarily going to be preserved. Aerospike maps can also be defined as K-ORDERED (ordered by keys) or KV-ORDERED (ordered by keys and values) ahead of storage - this means when you put() a map value, depending on that type, it will be stored either without order, or ordered. This affects the complexity (big-O) of the map operations (see the link I added for Maps).
The PHP client does not yet have the map operations, so it casts a PHP associative array to either the Aerospike map or list data types. If your array is a list it has integer indexed value monotonously increasing from 0. So:
[0 => ‘a’, 1 => ‘b’, 2 => ‘c’] will be cast to an Aerospike list.
[‘a’, ‘b’, ‘c’] is basically the same as above, so it’ll be an Aerospike list.
[100 => ‘a’, 207 => ‘b’] will be cast to an Aerospike map.
By the way, a PHP associative array is also flexible about whether it’s a list or a map. It doesn’t matter to PHP array or list operations how the data is ordered in the array().
As for your latest comment - please open that as either a bug in the PHP client’s repo at Github aerospike/aerospike-client-php, or a separate discussion under Client Libraries in this forum.