javacachinghashmaporacle-coherence

Cohql - apply filter for value which is inside map or list


I am using cohql for querying cache. I have one cached object which has a Hashmap as a property. Now when get a cache using get(key) and get NamedCache object.

I want to apply filter based on some value of property which is present inside the map. I have used like this -

QueryHelper.createFilter(“Obj.map{‘propertyName’}= ‘xyz’ “)

QuertHelper.createFilter(“Obj.list[‘property’]”)

But not working.

Anybody has any idea ?

Or how we query for collection data ?


Solution

  • Working on complex data types in coherence cache is similar to as we work normally with Java APIs

    For query map like object in cohql we can use For map -

    QueryHelper.createQuery(“Obj.get(‘key’) = ‘xyz’”)
    

    For detailed info - https://docs.oracle.com/cd/E24290_01/coh.371/e22622/strings.htm#BEIDEFED