Interaction of List operation (getByValue) and more complex data types


I had a question about the “get by value” list operation, and how it works with more complex types of data.

For context, I have a bin that is structured similarly to:

    “binA”: [{“key1”: ”val1”, “key2”:”val2”}]

I notice when using the java API, I can actually get a match with the below query:

            Map<String,String> map = new HashMap<>();
            map.put(“key2”, “val2”);
            Record lRecord = dbClient.operate(null, key,
                            new MapValue(map),

(assume key is some predefined primary key that is known, I ommitted it from the example record for brevity)

The above actually returns 1 (ie 1 match I guess?), so I was wondering how aerospike is able to do the matching when it comes to “complex” values?

Is it based on the hashcode, does the order of the map.put operations matter? (ie if I inserted “key2” before “key1” in my code, does that count as a different value?).

Couldn’t really find much in the documentation concerning this, any info is appreciated (If it matters, the client version is 5.1.11) Thanks, Ian

Its exact match of stored value. In the simplest case, if you inserted map unordered then “binA” = {k2:v2, k1:v1} will not match to {k1:v1, k2:v2} … so use ordered maps.

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.