Hi,
I am using aerospike KEY_ORDERED map for a usecase. When I am trying to get value of a key which does not exist in the map, I am getting “Error Code 4: Parameter error” error. Below is the code snippet
Key key = new Key(namespace, set, primarykey);
Record record = client.operate(null, key, MapOperation.getByKey("data", Value.get(keyname), MapReturnType.VALUE));
However the same code works fine and returns null for unordered_map.
Please let me know if I am missing something here. I want the KEY_ORDERED map to return a null value instead of the exception “Error Code 4: Parameter error”.
What is your Aerospike server version? Verified, I get the same failure on Server ver 3.16.0.6. I get the exception with KEY_VALUE_ORDERED also.
Exception in thread "main" com.aerospike.client.AerospikeException: Error Code 4: Parameter error
at com.aerospike.client.command.ReadCommand.parseResult(ReadCommand.java:111)
at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:84)
at com.aerospike.client.AerospikeClient.operate(AerospikeClient.java:1277)
This was a bug in server version 4.0.0.5. In the latest server version, both unordered and ordered maps return null values (no error) when the map key does not exist.