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

**URL:** <https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518>\
**Category:** Java Client\
**Tags:** query, java\
**Created:** [June 20, 2022, 7:52pm UTC](https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518 "2022-06-20T19:52:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iandntran](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@iandntran](https://discuss.aerospike.com/u/iandntran)\
**Post date:** [June 20, 2022, 7:52pm UTC](https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518/1 "2022-06-20T19:52:39Z")

</div>

Hi,

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:

```auto
{
    “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(“key1”,”val1”);
            map.put(“key2”, “val2”);
            Record lRecord = dbClient.operate(null, key,
                    ListOperation.getByValue(“binA”,
                            new MapValue(map),
                            ListReturnType.COUNT));

```

(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

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [June 20, 2022, 8:13pm UTC](https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518/2 "2022-06-20T20:13:15Z")

</div>

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** _.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [September 12, 2022, 8:13pm UTC](https://discuss.aerospike.com/t/interaction-of-list-operation-getbyvalue-and-more-complex-data-types/9518/3 "2022-09-12T20:13:57Z")

</div>

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